Showing posts with label GridView. Show all posts
Showing posts with label GridView. Show all posts

28 March 2009

Dyamic DataGrid

This Code is just get you started.

There would still be work to do but this will get the GridView there and gives a general idea of what to do with the columns.

GridView gDocuments = new GridView();
gDocuments.Visible = true;
gDocuments.ID = "gvDocs";
gDocuments.BackColor = System.Drawing.Color.Cornsilk;
gDocuments.BorderColor = System.Drawing.Color.

DarkMagenta;
gDocuments.BorderWidth = System.Web.UI.WebControls.
Unit.Pixel(5);
gDocuments.RowCommand += new GridViewCommandEventHandler(
gDocuments_RowCommand);

ButtonField bf1 = new ButtonField();
bf1.CommandName = "SelectRow";
bf1.Text = "Select This Row";
bf1.ButtonType = ButtonType.Button;
bf1.Visible = true;

gDocuments.Columns.Add(bf1);
pnlLayout.Controls.Add(
gDocuments);
Incase more Help needed let me know..

Rate Now: