I m working on an web application which gives information of user which use specific mailing system
grid having details of user is bound to webpage at runtime.
i m using web service to bind datagrid to page at runtime
i m asked to add one more column to this grid with name "Unlock user" which contains a link.
if 'account lock status' value taken from database is "Y" then i need to show the "unlock link" in "Unlock Column" else show nothing.
i have bound the column to grid and I fulfilled above condition too
but my problem is the above program runs fine for some time
that is when i click unlock button the program works fine
when i do this for 3 or more time(not fixed) even for first time also i get following error
"Collapse<br />
Index was out of range. Must be non-negative and less than the size of the collection.<br />
Parameter name: index<br />
the exception goes and again when i try to load page again sometimes it shows above exception again and when i click F5 program runs
I m not understanding when i click F5 then exception goes although i dont do anything then why its coming and to remove this what should i do?
public void EnableDisableControls()
{ FCS.BLL.CommonBLLOps dynobj = new FCS.BLL.CommonBLLOps();
string remoteUrl =System.Configuration.ConfigurationManager.AppSettings["SessionManager"];
DisableControls();//when this function s called i get exception and the function is defined below
public void DisableControls()
{
BtnAdd.Visible = false;
FlexiGrid1.Items[7].Hide = true;
}
and datagrid is
try
{
for (Int16 rowitem = 0; rowitem <= ItemCapacity-1; rowitem++)
{
_griddisplayitems += "{ display: '" + Items[rowitem].DisplayName +
"', name: '" + Items[rowitem].ColumnName +
"', width: " + Items[rowitem].ColumnWidth.ToString() +
", sortable: " + Items[rowitem].AllowSorting.ToString().ToLower() +
", hide: " + Items[rowitem].Hide.ToString().ToLower() +
", align: '" + Items[rowitem].ColumnAlignment.ToString() + "' },";
if (Items[rowitem].Searchable)
searchableitems += "{ display: '" + Items[rowitem].DisplayName +
"', name: '" + Items[rowitem].ColumnName + "' },";
}
_griddisplayitems = _griddisplayitems.Substring(0, _griddisplayitems.Length - 1);
if (searchableitems.Length > 0)
searchableitems = searchableitems.Substring(0, searchableitems.Length - 1);
}