Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Convert this c# to vb.net [closed]
- protected void dGrid_PreRender(object sender, EventArgs e)
- {
- try
- {
- DataGrid dgSidDetails = (DataGrid)sender;
- //Fix for numbering being in a left aligned column
- //For some reason, the ColumnSpan property is ignored andnot rendered
- //unless set using the Attributes
- if (dgSidDetails.AllowPaging == true && dgSidDetails.AutoGenerateColumns == false)
- {
- //Get the Table
- System.Web.UI.WebControls.Table tab =
- (System.Web.UI.WebControls.Table)dgSidDetails.Controls[0];
- if (dgSidDetails.PagerStyle.Position == PagerPosition.Top ||
- dgSidDetails.PagerStyle.Position == PagerPosition.TopAndBottom)
- {
- tab.Rows[0].Cells[0].Attributes.Add("colspan",
- tab.Rows[1].Cells.Count.ToString());
- }
- }
- }
- catch (Exception ex)
- {
- }
- }
- Protected Sub dGrid_PreRender(ByVal sender As Object, ByVal e As EventArgs)
- Try
- Dim dgSidDetails As DataGrid = CType(sender,DataGrid)
- //'Fix for numbering being in a left aligned column
- //'For some reason, the ColumnSpan property is ignored andnot rendered
- //'unless set using the Attributes
- If ((dgSidDetails.AllowPaging = true) _
- AndAlso (dgSidDetails.AutoGenerateColumns = false)) Then
- // 'Get the Table
- Dim tab As System.Web.UI.WebControls.Table = CType(dgSidDetails.Controls(0),System.Web.UI.WebControls.Table)
- If ((dgSidDetails.PagerStyle.Position = PagerPosition.Top) _
- OrElse (dgSidDetails.PagerStyle.Position = PagerPosition.TopAndBottom)) Then
- tab.Rows(0).Cells(0).Attributes.Add("colspan", tab.Rows(1).Cells.Count.ToString)
- End If
- End If
- Catch ex As Exception
- End Try
- End Sub
Add Comment
Please, Sign In to add comment