Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Custom DataGrid

Reply
Thread Tools

Custom DataGrid

 
 
Hermit Dave
Guest
Posts: n/a
 
      10-31-2003
Hello people,

This is my second post. Someone answer it...
Okay I had issues with using DataGrid control that comes by default. Had
some paging issues and also needed sort and filter to be added. Realised
that I need to write the code myself. So I got myself to building my custom
control.
It is not a composite control. I am drawing everything.
Was earlier thinking of using Repeater control but that would mean asking
the end user (me again) to do some extra stuff plus it was a pain cause sort
is normally done on column names and with repeater they aren't a part of it.
(meant scattered code if I don't make my own control)
anyhow
planning to use the ITemplate object to get info which would be similar to
DataGrid definition.
The problem is that I have know clue as to how Columns property is
implemented. Looked up the documentation and its some sealed class. Which
means not helpful at all.
* And how can I allow the user to use property builder to create columns and
specify paging info etc. What do I need to do ? any idea ?

Thanks a lot,

Regards,

HD


 
Reply With Quote
 
 
 
 
James Radke
Guest
Posts: n/a
 
      10-31-2003
HD,

Why would you need to create your own control to use custom paging, sorting
and filtering?

You can do all of these items fine with the existing datagrid: although
this does require that you do create some of your own code in the codebehind
module. I have several pages where I have 5 or so textbox/drop down lists
that allow the user to select their filtering criteria, and also enable the
headings of some of the columns to allow them to change the sort order from
asc to desc, etc...

What kinds of problems were you having? What, exactly, were you trying to
do? More information would be helpful....

Jim

"Hermit Dave" <(E-Mail Removed)> wrote in message
news:OxiGJN$(E-Mail Removed)...
> Hello people,
>
> This is my second post. Someone answer it...
> Okay I had issues with using DataGrid control that comes by default. Had
> some paging issues and also needed sort and filter to be added. Realised
> that I need to write the code myself. So I got myself to building my

custom
> control.
> It is not a composite control. I am drawing everything.
> Was earlier thinking of using Repeater control but that would mean asking
> the end user (me again) to do some extra stuff plus it was a pain cause

sort
> is normally done on column names and with repeater they aren't a part of

it.
> (meant scattered code if I don't make my own control)
> anyhow
> planning to use the ITemplate object to get info which would be similar to
> DataGrid definition.
> The problem is that I have know clue as to how Columns property is
> implemented. Looked up the documentation and its some sealed class. Which
> means not helpful at all.
> * And how can I allow the user to use property builder to create columns

and
> specify paging info etc. What do I need to do ? any idea ?
>
> Thanks a lot,
>
> Regards,
>
> HD
>
>



 
Reply With Quote
 
 
 
 
Hermit Dave
Guest
Posts: n/a
 
      11-01-2003
Hello Jim,

Okay the problem is that at work we set up a monitoring system using ASP.net
Portal Starter kit.
When i try using Paging with Datagrid and the type is Numeric Pages with
values 10 with more to next set and previous set. When i move to the next
set of pager links and say click on page 17 it does pull the right records
but the pager is reset to 1 to 10 and if there are say more than 20 pages
there's no way to move beyond unless i change the code to do custom paging.
Okay i know DataGrid is configurable and okay it can supprt lot of different
things but have to write code behind for everything and at the end of the
day if i am to use it in more than one page... duplicate the effort. The
second reason why i got onto designing a control is that the datagrid is
currently used in 8 odd pages and most dont have enough records for now to
have paging issues but sort and filter is required.
Plus with control i can set it to capture even and so dont have to write any
code in code behind.

So what i did was started with plain vanilla table... used table to display
the records (at the end of the day even a data grid generates table
structure to display) Plus my own PostBack events for the column and handle
it on the control itself. The problem i am facing is that i am forced to use
the Column Headers in the Datasource. Plus i can't define say specially link
columns to say open the edit page. Stuff like that

<aspataGrid id=DataGrid1 runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn HeaderImageUrl="Order ID"
DataField="orderid"></asp:BoundColumn>
<asp:BoundColumn HeaderImageUrl="Order Date"
DataField="orderdate"></asp:BoundColumn>
<asp:HyperLinkColumn Text="Order Details" Target="_blank"
DataNavigateUrlField="orderid"
DataTextField="orderid"
NavigateUrl="OrderDetail.aspx"></asp:HyperLinkColumn>
</Columns>
</aspataGrid>

okay now Columns is a property on the DataGrid control. How would you go
about creating something like that,
Will probably get around to working on it in the monring. Thanks,

HD

"James Radke" <(E-Mail Removed)> wrote in message
news:O0Mcsu$(E-Mail Removed)...
> HD,
>
> Why would you need to create your own control to use custom paging,

sorting
> and filtering?
>
> You can do all of these items fine with the existing datagrid: although
> this does require that you do create some of your own code in the

codebehind
> module. I have several pages where I have 5 or so textbox/drop down lists
> that allow the user to select their filtering criteria, and also enable

the
> headings of some of the columns to allow them to change the sort order

from
> asc to desc, etc...
>
> What kinds of problems were you having? What, exactly, were you trying to
> do? More information would be helpful....
>
> Jim
>
> "Hermit Dave" <(E-Mail Removed)> wrote in message
> news:OxiGJN$(E-Mail Removed)...
> > Hello people,
> >
> > This is my second post. Someone answer it...
> > Okay I had issues with using DataGrid control that comes by default. Had
> > some paging issues and also needed sort and filter to be added. Realised
> > that I need to write the code myself. So I got myself to building my

> custom
> > control.
> > It is not a composite control. I am drawing everything.
> > Was earlier thinking of using Repeater control but that would mean

asking
> > the end user (me again) to do some extra stuff plus it was a pain cause

> sort
> > is normally done on column names and with repeater they aren't a part of

> it.
> > (meant scattered code if I don't make my own control)
> > anyhow
> > planning to use the ITemplate object to get info which would be similar

to
> > DataGrid definition.
> > The problem is that I have know clue as to how Columns property is
> > implemented. Looked up the documentation and its some sealed class.

Which
> > means not helpful at all.
> > * And how can I allow the user to use property builder to create columns

> and
> > specify paging info etc. What do I need to do ? any idea ?
> >
> > Thanks a lot,
> >
> > Regards,
> >
> > HD
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Custom Collection that is bound to DataGrid made up of Custom COlumns Terry Holland ASP .Net Datagrid Control 9 10-28-2005 06:20 AM
Databinding to custom properties of a custom class in ASP.NET 2 =?Utf-8?B?SW1hciBTcGFhbmphYXJz?= ASP .Net 0 04-20-2005 07:34 PM
Capturing event from other custom control within another custom control Jonah Olsson ASP .Net 1 04-05-2005 01:39 PM
Question: Invoking custom file type (file associated with custom app) VB Programmer ASP .Net 1 11-03-2003 11:49 PM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments