Click here to Skip to main content
15,887,822 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone,

I am using one ascx control of gridview from where i can use it in multiple pages.

Now the issue is:

I have an additional control in gridview and after binding i am checking the condition and make that control visible true or false on every row.

It is binding and condition goes properly as per my requirement,

but when i am doing sorting or paging in gridview it is again binding and check conditions properly

but it shows that control on each on every row of the gridview.

Gridbinding and condition checking on aspx page and gridview is on ascx page.

Kindly do needful.

thanks in advance.
Posted
Comments
Jafarinejadvazifehkhorani 23-Jun-14 15:52pm    
please provide the code in order to make it clearer.
.Net Dada 26-Jun-14 2:20am    
FlexGrid flxAvailableAudits;
Hashtable results = new Hashtable();
results = bc.Execute(req);// mehtod that get data from databse
ResultSet rs = results["ResultSet"] as ResultSet;
flxAvailableAudits.ResultSet = rs;
flxAvailableAudits.DataBind();
for (int cnt = 0; cnt < flxAvailableAudits.DataView.Table.Rows.Count; cnt++)
{
GridViewRow gvr = flxAvailableAudits.GridView.Rows[cnt];
DataRow dr = flxAvailableAudits.DataView.Table.Rows[cnt];
if (dr["owner_name"].ToString() == mSysMsg.MemberAffiliationOwnerName.ToString())
{
gvr.Cells[0].Controls[0].Visible = true;
}
else
{
gvr.Cells[0].Controls[0].Visible = false;
}
}

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