pre render event for rad grid
protected void rgStateTax_PreRender( object sender, EventArgs e )
{
if( rgStateTax.MasterTableView.IsItemInserted )
{
foreach( GridItem item in rgStateTax.Items )
{
item.Visible = false;
}
}
if( rgStateTax.EditItems.Count > 0 )
{
foreach( GridDataItem item in rgStateTax.Items )
{
if( item != rgStateTax.EditItems[0] )
{
item.Visible = false;
}
}
}
}
here rgStateTax is rad grid and,Why they are making item as invisible iam a beginner in asp.net,PreRender is the event before the page is actually displayed on the screen rite?.
Status:
Open Apr 06, 2009 - 08:45 AM
prerender, render
1answer
Answer
Apr 06, 2009 - 08:58 AM
After googling i got some idea about this ,,means PreRender is the event that takes place just before the HTML for a given control/page is generated (to later be sent to the browser). So by setting an item.Visible = false here it will not be rendered to the HTML (however it's ViewState will). In this case it looks like the code is hiding all rows in the RadGrid when a user is editing/inserting an item I presume for less distractions for the end user.
Answer this question
Share Your Own Experience & Expertise
We look to ensure that every question is answered by the best people with relevant expertise and experience, the best answers include multiple perspectives. Do you have relevant expertise or experience to contribute your answer to any of these commonly asked questions?
Add New Comment