Usage of Dev control navbarcontrol

Source: Internet
Author: User
/// Create navbar Group private void creategroup () {datarow [] DRS = DT. select (""); // obtain all groups int I = 0; foreach (datarow DR in DRS) {I ++; devexpress. xtranavbar. navbargroup NBG = new devexpress. xtranavbar. navbargroup (); NBG. caption = Dr ["classname"]. tostring (); if (I = 1) NBG. expanded = true; // open the first navbarcontrol1.groups. add (NBG); createsublevel (convert. toint32 (Dr ["classid"]), NBG) ;}/// <summary> /// Construct the lower-level navbar sublevel /// </Summary> /// <Param name = "grpid"> group ID </param> /// <Param name = "passgroup) "> navbargroup name </param> private void createsublevel (INT grpid, devexpress. xtranavbar. navbargroup passgroup) {dt = getsublist (); foreach (datarow DR in DT. select ("parentid =" grpid "") {devexpress. xtranavbar. navbaritem NBI = new devexpress. xtranavbar. navbaritem (); NBI. caption = Dr ["classname"]. tostr Ing (); NBI. name = Dr ["winname"]. tostring (); NBI. tag = Dr ["classid"]. tostring (); NBI. smallimageindex = _ listsqu; passgroup. itemlinks. add (NBI); NBI. linkclicked + = new devexpress. xtranavbar. navbarlinkeventhandler (nbi_linkclicked); _ listsqu ++ ;}/// click the event private void nbi_linkclicked (Object sender, devexpress. xtranavbar. navbarlinkeventargs e) {try {string ls_form; ls_form = E. link. item. name. trim (); // Prevent multiple if (application. openforms [ls_form]! = NULL) {application. openforms [ls_form]. activate (); return;} string assemblyname = (ls_form.trim (). split ('. ') [0]; form FRM = (form) system. reflection. assembly. load (assemblyname ). createinstance (ls_form); frm. show ();} catch (exception ee) {MessageBox. show (EE. message); return ;}}

From: http://hi.baidu.com/jjlsky/blog/item/e2d869959a376356d0135e19.html

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.