Hi Expert,
In My website
Nridubai.com website i am showing
all companies and their information to admin.
For this purpose I have use gridview control, And each gridview cell is clickable.
And i am using following code for this,
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton _singleClickButton = (LinkButton)e.Row.Cells[0].Controls[0];
string _jsSingle = ClientScript.GetPostBackClientHyperlink(_singleClickButton, "");
for (int columnIndex = 0; columnIndex < e.Row.Cells.Count; columnIndex++)
{
string js = _jsSingle.Insert(_jsSingle.Length - 2, columnIndex.ToString());
e.Row.Cells[columnIndex].Attributes["onclick"] = js;
e.Row.Cells[columnIndex].Attributes["style"] += "cursor:pointer;cursor:hand;";
}
}
}
}
And I am fetching cell column index and row index on
GridView1_RowCommand event
Upto this working fine for me.
Now i have to display each cell value in popup when i click.
And i now i am using MOdalpopup extender(mpe).In that i take 2 textbox one for company and second for color.
But when i click cell,it opens modalpopup correctly,but failed to display the value associated with textboxes.
During debuging values assigning properly to textbox.but when it opens popup ,textboxes showing blank value.and if suppose i type something in it and close and then open modalpop again ,they showing existing values.
And i think this problem occurs due to following method
protected override void Render(HtmlTextWriter writer)
{
foreach (GridViewRow r in GridView1.Rows)
{
if (r.RowType == DataControlRowType.DataRow)
{
for (int columnIndex = 0; columnIndex < r.Cells.Count; columnIndex++)
{
Page.ClientScript.RegisterForEventValidation(r.UniqueID + "$ctl00", columnIndex.ToString());
}
}
}
base.Render(writer);
}
Please help me sort out the problem,And sorry for my poor english.
Thanks in advance.