A
Adam Sandler
Hello,
My codebehind builds a GridView at runtime and shovels the data off as
a part of a callback...
Dim returnstring As String = String.Empty
Dim gv As New GridView
gv.DataSource = ds
gv.DataBind()
gv.Visible = True
Using sw As New System.IO.StringWriter()
Dim htw As New HtmlTextWriter(sw)
gv.RenderControl(htw)
htw.Flush()
returnstring = returnstring + sw.ToString()
End Using
Dim cbr As New CallbackResult("div", "Div1", "innercontent",
returnstring)
map.CallbackResults.Add(cbr)
The above code works great but I'd like to be able to do some
formatting on the GridView... I can do things like:
gv.BorderColor = Drawing.ColorTranslator.FromHtml("#DEDFDE")
gv.FooterStyle.BackColor =
Drawing.ColorTranslator.FromHtml("#CCCC99")
Taken from the "mocha" pattern. But what about the codebehind
equivalents of this markup:
<asp:CommandField ShowSelectButton="True" />
--or--
<asp:BoundField DataField="DateTime" HeaderText="DateTime"
SortExpression="DateTime" />
??? with regard to the first one, I can only get as far as
gv.Columns.Item.CommandField.?
Suggestions are greatly appreciated. Thanks!
My codebehind builds a GridView at runtime and shovels the data off as
a part of a callback...
Dim returnstring As String = String.Empty
Dim gv As New GridView
gv.DataSource = ds
gv.DataBind()
gv.Visible = True
Using sw As New System.IO.StringWriter()
Dim htw As New HtmlTextWriter(sw)
gv.RenderControl(htw)
htw.Flush()
returnstring = returnstring + sw.ToString()
End Using
Dim cbr As New CallbackResult("div", "Div1", "innercontent",
returnstring)
map.CallbackResults.Add(cbr)
The above code works great but I'd like to be able to do some
formatting on the GridView... I can do things like:
gv.BorderColor = Drawing.ColorTranslator.FromHtml("#DEDFDE")
gv.FooterStyle.BackColor =
Drawing.ColorTranslator.FromHtml("#CCCC99")
Taken from the "mocha" pattern. But what about the codebehind
equivalents of this markup:
<asp:CommandField ShowSelectButton="True" />
--or--
<asp:BoundField DataField="DateTime" HeaderText="DateTime"
SortExpression="DateTime" />
??? with regard to the first one, I can only get as far as
gv.Columns.Item.CommandField.?
Suggestions are greatly appreciated. Thanks!