public class MyPage : Page
{
private bool newRowAdded;
private object newIdentityColumn;
protected void Grid_ItemDataBound(...)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
if (newRowAdded)
{
DataRowView row = (DataRowView)e.Item.DataItem;
if (row["identityColumn"] == newIdentityColumn)
{
e.Item.CssClass = "colorMe";
}
}
}
}
protected void Grid_InsertCommand(...)
{
newIdentityColumn = InsertRecordIntoDatabase();
newRowAdded = true;
Grid.DataSource = RefreshData();
Grid.DataBind();
}
}
-Brian
-----Original Message-----
From: stevens3t [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 26, 2004 9:08 AM
To: [EMAIL PROTECTED]
Subject: [C#.NET] Re: Index position in a Sorted DataView ?
No-one's jumped on this one.
Am what I'm looking at doing not possible ?
Thanks again ....
Steve
--- In [EMAIL PROTECTED], "stevens3t" <[EMAIL PROTECTED]>
wrote:
>
> We have a DataGrid component on an ASP.NET web form.
> We've got means to add a new row to an underlying table.
> We then call a method which sets up a DataView (dependent on
a 'Sort'
> criteria) and sets the DataSource of the DataGrid.
> If we know the IDX (identity field in the database table) how can
we
> establish the index position of the new row in the (sorted)
DataView ?
> Ideally we want to highlight the newly added row in the DataGrid.
> We've also got to then address the issue with paging in the
DataGrid
> but we'll sort that our after we've gotten over this first hurdle.
> Anyone offer any suggestions ?
> Thanks in advance,
> Steve
Yahoo! Groups Sponsor
ADVERTISEMENT
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/CSharpNET/
�
* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
�
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/CSharpNET/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
