Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Datagrid paging question

Reply
Thread Tools

Datagrid paging question

 
 
JK
Guest
Posts: n/a
 
      10-03-2004
Hi,

I use a datagrid and make use of paging. To add new records I use a stored
procedure in SQL server, which returns the unique ID of the new record. This
works well, but how can I make the datagrid automatically display (and
highlight) the newly added row (how do I retreive the page number of the new
row)?

Thanks for any help,

Joost


 
Reply With Quote
 
 
 
 
ranganh
Guest
Posts: n/a
 
      10-03-2004
Hi,

What you can do is to use a Dataview of your dataset and sort by the unique
id such that the latest added record is displayed the first.



"JK" wrote:

> Hi,
>
> I use a datagrid and make use of paging. To add new records I use a stored
> procedure in SQL server, which returns the unique ID of the new record. This
> works well, but how can I make the datagrid automatically display (and
> highlight) the newly added row (how do I retreive the page number of the new
> row)?
>
> Thanks for any help,
>
> Joost
>
>
>

 
Reply With Quote
 
 
 
 
JK
Guest
Posts: n/a
 
      10-04-2004
Thanks for your reply. yes, this could be a solution indeed, but I really
need to keep my alphabetic sorting order, any other ideas?

Joost

"ranganh" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> Hi,
>
> What you can do is to use a Dataview of your dataset and sort by the

unique
> id such that the latest added record is displayed the first.
>
>
>
> "JK" wrote:
>
> > Hi,
> >
> > I use a datagrid and make use of paging. To add new records I use a

stored
> > procedure in SQL server, which returns the unique ID of the new record.

This
> > works well, but how can I make the datagrid automatically display (and
> > highlight) the newly added row (how do I retreive the page number of the

new
> > row)?
> >
> > Thanks for any help,
> >
> > Joost
> >
> >
> >



 
Reply With Quote
 
Robert Koritnik
Guest
Posts: n/a
 
      10-04-2004
If your DataTable has a uniqe key constraint, you could find your newly
added row and check it's index in the DataTable.Rows collections. And
compute the page from that?

--
RobertK
{ Clever? No just smart. }

"JK" <(E-Mail Removed)> wrote in message
news:cjqpod$fg9$(E-Mail Removed)...
> Thanks for your reply. yes, this could be a solution indeed, but I really
> need to keep my alphabetic sorting order, any other ideas?
>
> Joost
>
> "ranganh" <(E-Mail Removed)> schreef in bericht
> news:(E-Mail Removed)...
> > Hi,
> >
> > What you can do is to use a Dataview of your dataset and sort by the

> unique
> > id such that the latest added record is displayed the first.
> >
> >
> >
> > "JK" wrote:
> >
> > > Hi,
> > >
> > > I use a datagrid and make use of paging. To add new records I use a

> stored
> > > procedure in SQL server, which returns the unique ID of the new

record.
> This
> > > works well, but how can I make the datagrid automatically display (and
> > > highlight) the newly added row (how do I retreive the page number of

the
> new
> > > row)?
> > >
> > > Thanks for any help,
> > >
> > > Joost
> > >
> > >
> > >

>
>



 
Reply With Quote
 
JK
Guest
Posts: n/a
 
      10-07-2004
Hi

How would that work?

Dim myrow As DataRow = myDS.Tables(0).Rows.Find(11) ???

Where 11 is the primary key of the added row and MyDS is a dataset

How do I get the index of this row? Or is this not the way to do it?

Thanks

Joost



"Robert Koritnik" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> If your DataTable has a uniqe key constraint, you could find your newly
> added row and check it's index in the DataTable.Rows collections. And
> compute the page from that?
>
> --
> RobertK
> { Clever? No just smart. }
>
> "JK" <(E-Mail Removed)> wrote in message
> news:cjqpod$fg9$(E-Mail Removed)...
> > Thanks for your reply. yes, this could be a solution indeed, but I

really
> > need to keep my alphabetic sorting order, any other ideas?
> >
> > Joost
> >
> > "ranganh" <(E-Mail Removed)> schreef in bericht
> > news:(E-Mail Removed)...
> > > Hi,
> > >
> > > What you can do is to use a Dataview of your dataset and sort by the

> > unique
> > > id such that the latest added record is displayed the first.
> > >
> > >
> > >
> > > "JK" wrote:
> > >
> > > > Hi,
> > > >
> > > > I use a datagrid and make use of paging. To add new records I use a

> > stored
> > > > procedure in SQL server, which returns the unique ID of the new

> record.
> > This
> > > > works well, but how can I make the datagrid automatically display

(and
> > > > highlight) the newly added row (how do I retreive the page number of

> the
> > new
> > > > row)?
> > > >
> > > > Thanks for any help,
> > > >
> > > > Joost
> > > >
> > > >
> > > >

> >
> >

>
>



 
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
Combining numeric mode paging and nextPreview paging in datagrid Red ASP .Net 1 03-12-2005 11:41 PM
datagrid paging - customising paging style wh1974 ASP .Net 0 01-12-2005 03:48 PM
datagrid , SQL Reader and Paging... Datagrid disappears Roger ASP .Net 0 12-28-2004 04:05 PM
DataSet paging vs Datareader paging =?Utf-8?B?UGF0cmljay5PLklnZQ==?= ASP .Net 1 10-08-2004 02:13 PM
Paging Dr. Who, Paging Dr. Who... Father_Sicko@TheOrphanage.com Computer Security 1 07-02-2004 08:59 PM



Advertisments