Problem with ColumnIDs when loading Header XML - Column IDS

I noticed that when I create and load the grid completly from XMLthe param names are defaulted to null in the request object



eg in the get.asmx page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Response.Clear()

Response.ContentType = “text/xml”

Response.ContentEncoding = Encoding.UTF8

Response.Write("<?xml version=""1.0"" encoding=""UTF-8""?>")

Response.Write("")

Response.Write(BuildHeader())

Response.Write("<row id="“1"”>")

Response.Write(“1”)

Response.Write(“2”)

Response.Write(“3”)

Response.Write("")

Response.Write("")

Response.End()

End Sub



Protected Function BuildHeader() As String

Dim sb As New StringBuilder



sb.Append("")

sb.Append(“Sales”)

sb.Append(“Book Title”)

sb.Append(“Author”)

sb.Append("")

sb.Append(“px”)

sb.Append("")

sb.Append("")



Return sb.tostring

End Function



After the grid has rendered and a cell is editted with auto update set to ‘cell’ and enableDataNames(true) the request object is as follows



RawUrl    “/EventReporting/update.aspx?gr_id=1&null=1&null=21&null=3”    String



if I set enableDataNames(false) then the request oblect is happy and has



RawUrl    “/EventReporting/update.aspx?gr_id=1&c0=1&c1=2&c2=13”    String





If I remove the … xml from my grid XML and set the grid up manually

with enableDataNames(true)



the request object is again happy



RawUrl    “/EventReporting/update.aspx?gr_id=1&Sale=1&Author=12&Book=3”    String







My Question is –



Is there a way of setting the ColumnIDs from the column>… XML



clearly the column title comes from the nodeText is there a columnid attribute in the tag that can be used to dynamically store the database column name - this would greatly improve the end to end connectivity of the grid to the db



thanks for your reply











Is there a way of setting the ColumnIDs from the column>… XML

It possible by setting id attribute of column tag

sb.Append("<column width=‘50’ id=“Sales”   type=‘ed’ align=‘right’ color=‘white’ sort=‘str’>Sales")

sb.Append("<column width=‘150’ id=“Book”   type=‘ed’ align=‘left’ color=’#d5f1ff’ sort=‘str’>Book Title")

sb.Append("<column width=‘100’ id=‘Author’   type=‘ed’ align=‘left’ color=’#d5f1ff’ sort=‘str’>Author")


>>clearly the column title comes from the nodeText is there a columnid attribute in the
It not the best approach, because sometimes column title can contain complex text, so the id attribute can be used instead.

Thanks for the reply - I had actually figured it out in a flash of inspiration - it was kind of obvious when you think about it LOL