# How to Set Active Row and Update epiDataView

**URL:** <https://www.epiusers.help/t/how-to-set-active-row-and-update-epidataview/87909>\
**Category:** Epicor ERP 10\
**Tags:** e10\
**Created:** [February 25, 2022, 9:03pm UTC](https://www.epiusers.help/t/how-to-set-active-row-and-update-epidataview/87909 "2022-02-25T21:03:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr\_dan](https://www.epiusers.help/user_avatar/www.epiusers.help/dr_dan/32/48005_2.png) [@dr\_dan](https://www.epiusers.help/u/dr_dan)\
**Post date:** [February 25, 2022, 9:03pm UTC](https://www.epiusers.help/t/how-to-set-active-row-and-update-epidataview/87909/1 "2022-02-25T21:03:06Z")

</div>

I am trying to select the most recent revision by default when a Part is loaded in Part Maintenance. Basically, it displays the revisions in ascending order and selects the first row by default (and shows that in the Details tab). I want to make it sort in descending order and select the most recent row (the first row). I don’t need the exact code if you can just paraphrase the sequence I need to follow.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![dr\_dan](https://www.epiusers.help/user_avatar/www.epiusers.help/dr_dan/32/48005_2.png) [@dr\_dan](https://www.epiusers.help/u/dr_dan)\
**Post date:** [February 28, 2022, 7:40pm UTC](https://www.epiusers.help/t/how-to-set-active-row-and-update-epidataview/87909/2 "2022-02-28T19:40:53Z")

</div>

Should I be working on the Ultragrid? The epiView? etc. I’m sort of poking around and I can’t seem to find anything that works in Google and my understanding of the objects is still very little.

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [February 28, 2022, 8:30pm UTC](https://www.epiusers.help/t/how-to-set-active-row-and-update-epidataview/87909/3 "2022-02-28T20:30:33Z")

</div>

You should be working with the view. You can get the current row by getting ahold of the view and .Row is the current row.

The object explorer has the data views that are available in the customization, and some basic code to show you how to get ahold of the data.

![image](https://www.epiusers.help/uploads/default/original/3X/2/5/2557703b50ceb44cce091e4b1a3b9dd5a6360270.png)

 ![image](https://www.epiusers.help/uploads/default/original/3X/0/c/0c78699e1fac88accfc1725f689de13f66e45015.png)

---

<div class="post-metadata">

**Author:** ![dr\_dan](https://www.epiusers.help/user_avatar/www.epiusers.help/dr_dan/32/48005_2.png) [@dr\_dan](https://www.epiusers.help/u/dr_dan)\
**Post date:** [February 28, 2022, 8:36pm UTC](https://www.epiusers.help/t/how-to-set-active-row-and-update-epidataview/87909/4 "2022-02-28T20:36:07Z")

</div>

Great feedback! Thank you.  
I’ll give it a go.

---

<div class="post-metadata">

**Author:** ![dr\_dan](https://www.epiusers.help/user_avatar/www.epiusers.help/dr_dan/32/48005_2.png) [@dr\_dan](https://www.epiusers.help/u/dr_dan)\
**Post date:** [February 28, 2022, 9:17pm UTC](https://www.epiusers.help/t/how-to-set-active-row-and-update-epidataview/87909/5 "2022-02-28T21:17:49Z")

</div>

Final solution:  
I added an EpiViewNotification on the Part view.  
Then I changed the notification type to Initialize.

```auto
	private static void edvPart_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
	{
		// **Argument Properties and Uses**
		// view.dataView[args.Row]["FieldName"]
		// args.Row, args.Column, args.Sender, args.NotifyType
		// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
		if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
		{
			if ((args.Row > -1))
			{
				if (edvPartRev.dataView.Count > 0)
				{
					edvPartRev.Row = edvPartRev.dataView.Count - 1;
				}
			}
		}
	}

```
