Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want hide first two rwo in the datagridview but
runtime is not hiding in the datagridview using C#
windows application
plz tell how to do it.

i did the code but it is not working:

My code:
C#
public void LoadClientAssumption()
       {

           string[] field = new string[5] { "ClientAssumptionId", "AssumptionId", "ClientId", "Description", "Percentage" };
           FillData.FillGrid(dgvAssumption, "vwGetClientAssumption", field, ClientBasicInfoVO.ClientId);


           var binding = new BindingSource();
           binding.DataSource = field;
           dgvAssumption.DataSource = binding;


           DataGridViewRow dr;

           CurrencyManager currencyManager1 = (CurrencyManager)BindingContext[binding];
           currencyManager1.Position = 0;





               if (dgvAssumption.Rows[0].Visible == true)
               {

                   currencyManager1.SuspendBinding();
                   dgvAssumption.Rows[0].Visible = false;



               }
[Edit]Code block added[/Edit]
Posted
Updated 28-Mar-13 3:30am
v2
Comments
Naz_Firdouse 29-Mar-13 1:38am    
did u debug the code???
does it enters into if condition?

1 solution

C#
protected void dgvAssumption_ItemDataBound(object sender, GridItemEventArgs e)
        {

if (e.Item is GridDataItem)
{

// You can get the grid  items, just hide from here..

}

}
 
Share this answer
 
Comments
sadhana4 30-Mar-13 13:33pm    
yes i solved it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900