hi is it possible to bind gridview inside of usercontrol from content page, if so how?
+2
A:
Yes, the easiest way would be to expose the bind in the user control and then call it from your page.
//in user control, add this method
public void BindGrid()
{
gvInnerGrid.DataBind();
}
//on your page
userControl.BindGrid();
Biff MaGriff
2010-07-13 22:19:08
Hi it works thank you. I need to pass IQueryable object in order to bind GridView with data. And then to query this object inside of user control. Do you know how to do it?
German
2010-07-13 22:47:07
You could use the same method to pass the data. Personally I would make a public property on the user control that exposes the grid's DataSource.ex.//user controlpublic object DataSource{get{return gvInnerGrid.DataSource;} set {gvInnerGrid.DataSource = value;}}
Biff MaGriff
2010-07-13 22:50:46
Ok Thank you Biff it is working now )
German
2010-07-13 23:21:18