Apr 30, 2015, 3:57 AM
[CLOSED] Checkbox selection model is not working as expected.
Hi,
I have a gridpanel which has to be loaded on a view button click. Below is the event code:
I have a gridpanel which has to be loaded on a view button click. Below is the event code:
private void BindTier2()
{
int tmMonth;
int tmYear;
tmMonth = string.IsNullOrEmpty(CmbMonth.SelectedItem.Value) ? -1 : int.Parse(CmbMonth.SelectedItem.Value);
tmYear = string.IsNullOrEmpty(CmbYear.SelectedItem.Value) ? -1 : int.Parse(CmbYear.SelectedItem.Value);
PBView objPBViews = new AP3.Core.Bll.Mbm.PBView();
DataTable dtTierMapping = new DataTable();
dtTierMapping = objPBViews.GetETmetricsTier2Mapping(tmMonth, tmYear);
str2TierMapping.RemoveAll();
str2TierMapping.DataSource = dtTierMapping;
str2TierMapping.DataBind();
RowSelectionModel sm = this.grdTier2Mapping.SelectionModel.Primary as RowSelectionModel;
sm = this.grdTier2Mapping.SelectionModel.Primary as RowSelectionModel;
sm.SelectedRow = new SelectedRow(2);
sm.SelectedRows.Add(new SelectedRow(0));
sm.SelectedRows.Add(new SelectedRow(2));
}
I have a checkbox selection model in the gridpanel and I want some of the rows to be automatically checked while loading. If I call the above function in a page load it is working fine. But When I call the same function inside a view button click event only the grid is loading but the check boxes are not being checked. Please help.
Last edited by Daniil; Apr 30, 2015 at 4:22 PM.
Reason: [CLOSED]