Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
rosh #1
adding button to header, footer or Pager of dataGrid
hi
i want to know whether is it possible to add button (say DELETE button)
in the header,footer or Pager of a dataGrid?
If yes,how do i achieve the same?
thnkx
cheers
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
rosh Guest
-
Customizing pager/header/footer
I need to put web controls inside pager, header or footer parts of the datagrid. Any ideas? -
Adding ImageButton to a datagrid header
Ok, o I have a datagrid with sorting and paging. I would like to add a small ImageButton right under the header text that I currently use for... -
Adding ImageButton To DataGrid Header
Hello This is probable a simple one for all you experts out there. I was wondering what the most efficient way of dynamically assigning a URL... -
Nested Datagrid Inner Grid adding button column
I'm creating a hierarchical, editable ASP.NET datagrid with drilldown using two SQL tables. The "child" rows sit inside a cell of its "parent". ... -
Adding textboxes for filtering in DataGrid header
Hi All, - Visual Studio 2002 - VB.NET > ASP.NET I created a DataGrid on a webform. This datagrid has sorting enabled. I want to create in the... -
A Traveler #2
Re: adding button to header, footer or Pager of dataGrid
Header and footer are easy enough. Which ever column you want the button in,
simply make it a template column, and then edit the template by
right-clicking the grid and going to "Edit Template..."
You can also do it through code, which would be the only way if you want to
edit the pager. You can handle the OnItemCreated event for the grid, then do
a Select Case e.Item.ItemType, and look for the type you want to edit. Then
go ahead and add your controls as you wish.
** The only caveat about doing it in code is that it CAN potentially become
very tricky to create and recreate this controls properly on postbacks and
rebinds, because of issues with needing to create the pages
viewstate/control hierarchy in excatly the same fashion it was originally
created.
I hope this helps you some.
"rosh" <urgent@devdex.com> wrote in message
news:ON2VuEErEHA.2856@TK2MSFTNGP10.phx.gbl...>
> hi
> i want to know whether is it possible to add button (say DELETE button)
> in the header,footer or Pager of a dataGrid?
> If yes,how do i achieve the same?
> thnkx
> cheers
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
A Traveler Guest
-
rosh #3
Re: adding button to header, footer or Pager of dataGrid
thnkx a lot for ru quick reply :)
yeh tht worked :)
now i will try the same on PAGER of the dataGrid
now one more question arrises as to whether can i do the same by adding
image buttons?
I have a header fielt say "SortIt" and i want that column to be sorted
both ways(ascd'ng and descending)and also i want to append the image to
the header text "SortIt"[image]
All i want is when i click on this header the sorting must take place
and the image must change according to ascenging n descending sort...
i tried this by adding a Header Image through ProgramBuilder but then if
i add the image from there i am not able to see my header text :( wht do
i do?
can u suggest some idea for the same
have a nice time
cheers
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
rosh Guest
-
Travis Walker #4
Re: adding button to header, footer or Pager of dataGrid
Private Sub gvResults_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvResults.RowCreated
' After Row is created, see what type of row it was
Select Case e.Row.RowType
' Find the Pager Row
Case DataControlRowType.Pager
' Build LinkButton and create handler
Dim LnkBtnExport As New LinkButton
LnkBtnExport.ID = "LnkBtnExport"
LnkBtnExport.Text = "Export To Excel"
AddHandler LnkBtnExport.Click, AddressOf LnkBtnExportClicked
' Create a New Table Cell
Dim tc As New TableCell
' Add Table Cell to the inside of the Pager Table
' e.row.cells(0).Controls(0) is the table
' e.row.cells(0).controls(0).controls(0) is the TR
' e.row.cells(0).controls(0).controls(0).Controls is the TD collection
e.Row.Cells(0).Controls(0).Controls(0).Controls.Ad d(tc)
' add the link button to the new table cell
tc.Controls.Add(LnkBtnExport)
End Select
End Sub
Private Sub LnkBtnExportClicked(ByVal sender As Object, ByVal e As EventArgs)
' BUILD BUTTON FUNCTION HERE
End Sub
Junior Member
- Join Date
- Apr 2011
- Posts
- 1



Reply With Quote

