How to programmatically check select in EpiUltraGrid row

Thanks Greg. My code actually was working, but the sort was the wrong direction. The grid I was testing with is very long and everything sorted to the end and I didn't notice until after I posted the question.

Tim

--- In vantage@yahoogroups.com, "Rodzewicz, Greg" <grodzewicz@...> wrote:
>
> Tim,
>
> I haven't done anything with the grids so this could just be useless garbage but here is how I would try it.
>
> EpiDataView empview = (EpiDataView)oTrans.EpiDataViews["Emp"];
>
> if (empview.dataView.Count > 0 && empview.Row >= 0)
> emp = empview.dataView[empview.Row]["EmpID"].ToString();
>
> Int i = 0;
>
> foreach (Infragistics.Win.UltraWinGrid.UltraGridRow r in expwrkDtlGrd.Rows)
> {
> tmp = r.Cells["SchResourceList"].Value.ToString();
> if (String.Compare(tmp.Substring(tmp.IndexOf("~")+1,5),emp)==0)
> expwrkDtlGrd.Rows[i]["Selected"] = true;
> i++;
> }
>
> expwrkDtlGrd.DisplayLayout.Bands[0].Columns["Selected"].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Ascending;
> expwrkDtlGrd.DisplayLayout.Bands[0].Columns["Selected"].Band.SortedColumns.RefreshSort(true);
> expwrkDtlGrd.Refresh();
>
>
> Gregory Rodzewicz
> Developer
> Norgren Automation Solutions
>
> Direct Dial: (734) 429 8946
> Email: grodzewicz@...
> Web: www.norgrenauto.com
>
> 1325 Woodland Drive, Saline, MI 48176 | 2871 Bond Street, Rochester Hills, MI, 48309
>
> NORGREN - WE DELIVER ENGINEERING ADVANTAGE
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Tim Vonderhaar
> Sent: Monday, July 02, 2012 11:26 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] How to programmatically check select in EpiUltraGrid row
>
>
>
> I would like to check and ultimately sort expected work in a MES EpiUltraGrid and I am struggling to figure out how to mimic the check. In code, I'm looping through the rows and when I find a match between an employee and the SchResourceList, I want to set Selected. Here is what I have so far;
>
> EpiDataView empview = (EpiDataView)oTrans.EpiDataViews["Emp"];
>
> if (empview.dataView.Count > 0 && empview.Row >= 0)
> emp = empview.dataView[empview.Row]["EmpID"].ToString();
>
> foreach (Infragistics.Win.UltraWinGrid.UltraGridRow r in expwrkDtlGrd.Rows)
> {
> tmp = r.Cells["SchResourceList"].Value.ToString();
> if (String.Compare(tmp.Substring(tmp.IndexOf("~")+1,5),emp)==0)
> r.Cells["Selected"].Value = true;
> }
>
> expwrkDtlGrd.DisplayLayout.Bands[0].Columns["Selected"].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Ascending;
> expwrkDtlGrd.DisplayLayout.Bands[0].Columns["Selected"].Band.SortedColumns.RefreshSort(true);
> expwrkDtlGrd.Refresh();
>
> I'm sure I'm missing the obvious.
>
> Thanks,
> Tim
>
>
> ________________________________
> CONFIDENTIALITY NOTICE - This e-mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the person to whom this e-mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. Any commodities, technology or software exported in this e-mail are being exported from the United States in accordance with export administration regulations, diversion contrary to USA law is prohibited.
>
>
> [Non-text portions of this message have been removed]
>
I would like to check and ultimately sort expected work in a MES EpiUltraGrid and I am struggling to figure out how to mimic the check. In code, I'm looping through the rows and when I find a match between an employee and the SchResourceList, I want to set Selected. Here is what I have so far;

EpiDataView empview = (EpiDataView)oTrans.EpiDataViews["Emp"];

if (empview.dataView.Count > 0 && empview.Row >= 0)
emp = empview.dataView[empview.Row]["EmpID"].ToString();

foreach (Infragistics.Win.UltraWinGrid.UltraGridRow r in expwrkDtlGrd.Rows)
{
tmp = r.Cells["SchResourceList"].Value.ToString();
if (String.Compare(tmp.Substring(tmp.IndexOf("~")+1,5),emp)==0)
r.Cells["Selected"].Value = true;
}

expwrkDtlGrd.DisplayLayout.Bands[0].Columns["Selected"].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Ascending;
expwrkDtlGrd.DisplayLayout.Bands[0].Columns["Selected"].Band.SortedColumns.RefreshSort(true);
expwrkDtlGrd.Refresh();

I'm sure I'm missing the obvious.

Thanks,
Tim
Tim,

I haven't done anything with the grids so this could just be useless garbage but here is how I would try it.

EpiDataView empview = (EpiDataView)oTrans.EpiDataViews["Emp"];

if (empview.dataView.Count > 0 && empview.Row >= 0)
emp = empview.dataView[empview.Row]["EmpID"].ToString();

Int i = 0;

foreach (Infragistics.Win.UltraWinGrid.UltraGridRow r in expwrkDtlGrd.Rows)
{
tmp = r.Cells["SchResourceList"].Value.ToString();
if (String.Compare(tmp.Substring(tmp.IndexOf("~")+1,5),emp)==0)
expwrkDtlGrd.Rows[i]["Selected"] = true;
i++;
}

expwrkDtlGrd.DisplayLayout.Bands[0].Columns["Selected"].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Ascending;
expwrkDtlGrd.DisplayLayout.Bands[0].Columns["Selected"].Band.SortedColumns.RefreshSort(true);
expwrkDtlGrd.Refresh();


Gregory Rodzewicz
Developer
Norgren Automation Solutions

Direct Dial: (734) 429 8946
Email: grodzewicz@...
Web: www.norgrenauto.com

1325 Woodland Drive, Saline, MI 48176 | 2871 Bond Street, Rochester Hills, MI, 48309

NORGREN - WE DELIVER ENGINEERING ADVANTAGE

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Tim Vonderhaar
Sent: Monday, July 02, 2012 11:26 AM
To: vantage@yahoogroups.com
Subject: [Vantage] How to programmatically check select in EpiUltraGrid row



I would like to check and ultimately sort expected work in a MES EpiUltraGrid and I am struggling to figure out how to mimic the check. In code, I'm looping through the rows and when I find a match between an employee and the SchResourceList, I want to set Selected. Here is what I have so far;

EpiDataView empview = (EpiDataView)oTrans.EpiDataViews["Emp"];

if (empview.dataView.Count > 0 && empview.Row >= 0)
emp = empview.dataView[empview.Row]["EmpID"].ToString();

foreach (Infragistics.Win.UltraWinGrid.UltraGridRow r in expwrkDtlGrd.Rows)
{
tmp = r.Cells["SchResourceList"].Value.ToString();
if (String.Compare(tmp.Substring(tmp.IndexOf("~")+1,5),emp)==0)
r.Cells["Selected"].Value = true;
}

expwrkDtlGrd.DisplayLayout.Bands[0].Columns["Selected"].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Ascending;
expwrkDtlGrd.DisplayLayout.Bands[0].Columns["Selected"].Band.SortedColumns.RefreshSort(true);
expwrkDtlGrd.Refresh();

I'm sure I'm missing the obvious.

Thanks,
Tim


________________________________
CONFIDENTIALITY NOTICE - This e-mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the person to whom this e-mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. Any commodities, technology or software exported in this e-mail are being exported from the United States in accordance with export administration regulations, diversion contrary to USA law is prohibited.


[Non-text portions of this message have been removed]