H
HalaszJ
I have 2 Questions that I cant seem to find the answers for. How can I
create a programmatic datagrid sort? And how can I use a
hyperlinkcolumn and have it pass the id of the item where the event
was clicked?
dg.AutoGenerateColumns = false;
dg.AllowSorting = true;
dg.SortCommand += new DataGridSortCommandEventHandler(dgSort);
BoundColumn tID = new BoundColumn();
tID.DataField = "TERMINALID";
tID.HeaderText = "Terminal ID";
tID.SortExpression = "t.terminalid";
HyperLinkColumn mID = new HyperLinkColumn();
mID.DataTextField = "MERCHANTID";
mID.NavigateUrl = "http://localhost/cams/configuration/merchants/main.aspx?
merchantid='NEED SELECTED ITEM ID HERE'";
mID.HeaderText = "Merchant ID";
mID.SortExpression = "m.merchantid";
....
dg.Columns.Add(tID);
dg.Columns.Add(mID);
....
cn.Open();
dg.DataSource = cmd.ExecuteReader();
dg.DataBind();
create a programmatic datagrid sort? And how can I use a
hyperlinkcolumn and have it pass the id of the item where the event
was clicked?
dg.AutoGenerateColumns = false;
dg.AllowSorting = true;
dg.SortCommand += new DataGridSortCommandEventHandler(dgSort);
BoundColumn tID = new BoundColumn();
tID.DataField = "TERMINALID";
tID.HeaderText = "Terminal ID";
tID.SortExpression = "t.terminalid";
HyperLinkColumn mID = new HyperLinkColumn();
mID.DataTextField = "MERCHANTID";
mID.NavigateUrl = "http://localhost/cams/configuration/merchants/main.aspx?
merchantid='NEED SELECTED ITEM ID HERE'";
mID.HeaderText = "Merchant ID";
mID.SortExpression = "m.merchantid";
....
dg.Columns.Add(tID);
dg.Columns.Add(mID);
....
cn.Open();
dg.DataSource = cmd.ExecuteReader();
dg.DataBind();