

I have a grid with many pages (allowpaging = true) and I want onprerender
that some items will be selected = true
I have this code :
protected void Grid_MailingList_PreRender(object sender, EventArgs e)
{
foreach (GridDataItem item in Grid_MailingList.Items)
{
string person = SessionMng.MessagesListData.Tables[0].Rows[i++]["iPersonId"].ToString();
DataView dv = new DataView(SessionMng.SavedMessage.Tables[1], "iPersonId= '" + person + "'", "", DataViewRowState.CurrentRows);
if (dv.ToTable().Rows.Count > 0)
item.Selected = true;
}
}
}
}
but it work only in the first page of the grid.
how can I pass on all of the pages at the grid ?
<
telerik:RadGrid ID="RadGrid1" AutoGenerateEditColumn="false" runat="server"
AllowAutomaticDeletes="False" AllowAutomaticInserts="False" AllowAutomaticUpdates="False"
AllowPaging="True" AllowSorting="true" OnItemCommand="gridRequestList_ItemCommand" >
<MasterTableView EditMode="PopUp" CommandItemDisplay="Top" AutoGenerateColumns="false"
AllowAutomaticInserts="false" AllowAutomaticUpdates="false" >
<Columns>
columns here
</Columns>
<EditFormSettings InsertCaption="Setup Info" EditFormType="Template">
<FormTemplate> code here </FormTemplate>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
protected
void grid_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName.Equals(RadGrid.PerformInsertCommandName))
{
string txtName = ((TextBox)e.Item.FindControl("txtName")).Text;
}
}
Thanks.
tj
html body form .RadInput .missingMandatoryField /*RadTextBox Implementation*/ { background-color: #F6CBCA }function fnOnUpdateValidators() { for (var i = 0; i < Page_Validators.length; i++) { var val = Page_Validators[i]; var ctrl = document.getElementById(val.controltovalidate); if (ctrl != null) { //Remove the existing Class Data. ctrl.className = ctrl.className.replace("missingMandatoryField", ""); ctrl.className = ctrl.className.replace(" mandatoryField", ""); if (!val.isvalid) ctrl.className += " missingMandatoryField"; else ctrl.className += " mandatoryField"; } } }