Wednesday, August 11, 2010
Displaying row details in textboxes on mouseover of gridview row in asp.net 3.5?
I haved used a DataTable to fill a grid. On mouse over of a row ,I want to show some other info about this row in some textboxes . I really don’t know how to do this.
Can anyone help?
Thanks in advance.Displaying row details in textboxes on mouseover of gridview row in asp.net 3.5?
Hey, you want to use a popupcontrolextender. I've never done it on a mouseover of the row itself though. That might slow things down a bit.
Here is a sample of what you would want to do if you used just a column.
%26lt;!-- aspx --%26gt;
%26lt;asp:TemplateField%26gt;
%26lt;ItemTemplate%26gt;
%26lt;asp:Image ID=';Image1'; runat=';server'; ImageUrl=';~/Img/mg.gif'; /%26gt;
%26lt;ajaxToolkit:PopupControlExtender ID=';PopupControlExtender1'; runat=';server'; DynamicContextKey='%26lt;%# Eval(';Myid';) %%26gt;'
DynamicControlID=';Panel1'; DynamicServiceMethod=';GetPopupHTML'; DynamicServicePath=';~/WebServices/MyServ鈥?br>
PopupControlID=';Panel1'; Position=';Bottom'; TargetControlID=';Image1';%26gt;
%26lt;/ajaxToolkit:PopupControlExtender%26gt;
%26lt;/ItemTemplate%26gt;
%26lt;/asp:TemplateField%26gt;
//c# webservice
[WebMethod]
public string GetPopupHTML(string contextKey)
{
StringBuilder sTemp = new StringBuilder();
sTemp.Append(';%26lt;table class=\';popUp\';%26gt;';);
//do whatever you want to show your data
//you can use controls by using a string writer
GridView gv1 = new GridView();
gv1.DataSource = myds;
gv1.DataBind();
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter myWriter = new HtmlTextWriter(sw);
gv1.RenderControl(myWriter);
return sw.ToString();
}
Good luck
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment