Click here to Skip to main content
15,911,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a gridview which is bounded with a Datatable. I have a button column in the gridview and on its click I am updating other row data and color. Data is been retained and color of the cell.
But when I am clicking other rows button, that particular rows color is retained but remaining color is again reverted to default. How can I rectify this. Please suggest.
Thanks
Sreenath
Posted
Comments
Sunasara Imdadhusen 9-Feb-11 0:25am    
Please provide snippet of code!!
Sreenath Gv 9-Feb-11 0:26am    
Hi, I am handling this in this way...

void lFnGridConnStatusColorSetForRows()
{

try
{

foreach (GridViewRow lObjRow in grdDBDetails.Rows)
{
Label lObjLblData = null;

lObjLblData = (Label)lObjRow.FindControl("lblConnStatus");

if (lObjLblData != null)
{
if (lObjLblData.Text.Trim() == CONST_CONNECTED)
{
lFnSetGridCellConnectStatus(ENUM_DB_CONN_STATUS.CONNECTED, 4, lObjRow.RowIndex);
continue;
}

if (lObjLblData.Text.Trim() == CONST_CONNECTION_FAILED)
{
lFnSetGridCellConnectStatus(ENUM_DB_CONN_STATUS.CONNECTION_FAILED, 4, lObjRow.RowIndex);
continue;
}

}
}


}
catch (Exception)
{

throw;
}

}
Sreenath Gv 9-Feb-11 0:27am    
This is working fine when I am at current row, But when I am calling this at load during post back...it is throwing error as

nvalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

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