G
GaryDean
I have a GridView datasourced by a SQLDataSource with Enable Sorting and
Enable Selection turned on. However I don't like the headings and all of
the columns that come from the SQLDataSource in in the RowDataBound event I
do...
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[billmethod].Visible = false;
e.Row.Cells[dateissued].Visible = false;
e.Row.Cells[receiptamt].Visible = false;
e.Row.Cells[cbmark].Text = "Mark";
e.Row.Cells[viewinvoice].Text = "View Doc";
e.Row.Cells[invoicenumber].Text = "Invoice #";
e.Row.Cells[billtoorganization].Text = "Bill To Company";
e.Row.Cells[createdate].Text = "Created";
e.Row.Cells[billcycle].Text = "Pay Type";
e.Row.Cells[status].Text = "Status";
e.Row.Cells[invamt].Text = "Bill Amt";
e.Row.Cells[amtreceived].Text = "Amt Rec";
e.Row.Cells[orgtype].Text = "Aging";
}
This has apparently nuked my sorting feature because my custom headings are
not underlined and clicking on them does not sort. They are born dead. Now
if I hit the select button on any row, the grid shows the headings from SQL
and the sort feature is restored. It stays restored until the next time
RowDataBound is triggered.
I want to have custom headings and the sort capability. Is this possible
without changing my sql?
Thanks,
Gary
Enable Selection turned on. However I don't like the headings and all of
the columns that come from the SQLDataSource in in the RowDataBound event I
do...
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[billmethod].Visible = false;
e.Row.Cells[dateissued].Visible = false;
e.Row.Cells[receiptamt].Visible = false;
e.Row.Cells[cbmark].Text = "Mark";
e.Row.Cells[viewinvoice].Text = "View Doc";
e.Row.Cells[invoicenumber].Text = "Invoice #";
e.Row.Cells[billtoorganization].Text = "Bill To Company";
e.Row.Cells[createdate].Text = "Created";
e.Row.Cells[billcycle].Text = "Pay Type";
e.Row.Cells[status].Text = "Status";
e.Row.Cells[invamt].Text = "Bill Amt";
e.Row.Cells[amtreceived].Text = "Amt Rec";
e.Row.Cells[orgtype].Text = "Aging";
}
This has apparently nuked my sorting feature because my custom headings are
not underlined and clicking on them does not sort. They are born dead. Now
if I hit the select button on any row, the grid shows the headings from SQL
and the sort feature is restored. It stays restored until the next time
RowDataBound is triggered.
I want to have custom headings and the sort capability. Is this possible
without changing my sql?
Thanks,
Gary