Home > Net >  Recursive judge last level
Recursive judge last level

Time:10-02

How to use recursive last level, not the final one.
Is the last level.
 
DRS DataRow []=dt. Select (" frm_father_id='" + fatherid + "' ");
Foreach (DataRow item in DRS)
{
//recursive judgment finally level 1
If (item!=DRS [DRS. Length - 1])

{
String text=item [r]. "frm_cname" ToString ();
BarSubItem mitem=new BarSubItem (barManager1, text);
Mitem. Tag=item;
DevexpreeCreateSubMenuItem (mitem, item [r]. "frm_id" ToString (), dt);
Menu. ItemLinks. Add (mitem);

}
The else
{
String text=item [r]. "frm_cname" ToString ();
BarButtonItem mitem=new BarButtonItem (barManager1, text);
Mitem. Tag=item;
Menu. ItemLinks. Add (mitem);
Mitem. ItemClick +=new ItemClickEventHandler (DevExpressBindClickToInstinse);

}
}
//for (int I=0; I & lt; DRS. Length; I++)
//{
//if (I==DRS. Length - 1)
//{
//string text=DRS [I] [r]. "frm_cname" ToString ();
//BarSubItem mitem=new BarSubItem (barManager1, text);
//mitem. Tag=DRS [I];
//DevexpreeCreateSubMenuItem (mitem, DRS [I] [r]. "frm_id" ToString (), dt);
//menu. ItemLinks. Add (mitem);

//}
//else
//{
//string text=DRS [I] [r]. "frm_cname" ToString ();
//BarButtonItem mitem=new BarButtonItem (barManager1, text);
//mitem. Tag=DRS [I];
//menu. ItemLinks. Add (mitem);
//mitem ItemClick +=new ItemClickEventHandler (DevExpressBindClickToInstinse);


//}
//}
  •  Tags:  
  • C#
  • Related