473,732 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vb.net:Show symbol "+" in each row of datagrid if got children

28 New Member
hello, everyone
Sorry for disturb..
im newbie to asp.net
im trying to do a task that as below:

In a SAME datagrid, it ll show all data when user key in key word in textbox...
datagrid will show out Personnel number,Firstnam e,Lastname...an d last is direct manager personnel number
i create a column in datagrid, and put symbol '+'..
if the datagrid item of each row have children, then show '+',to expand it...
how parent and children related?
ok, let me define here:
each employee hav a personnel number and direct manager personnel number
each employee hav a person direct to
for example, IT manager hav a personnel number --10,and direct manager personnel number -1
it mean that all employee in IT department will hav 10 as their direct manager personnel number b/cos they report to IT manager
and the IT manager report to CEO who hav 1 as his personnel number

I want my datagrid to show "+" in each datagrid item in each row if there are employee report to the person, and show nothing if the person does not have employee report to him..

i successful to display what i wan
but it take LONG TIME to complete it
i think is my coding going wrong
i hope senior in here can give me some direction:

method i use is :
i use 2 datagrid-- datagrid1 and datagrid2(invis ible)

at dataGrid1_itemD ataBound, i databind each row personnel_numbe r as DirectNo into datagrid2 and get result if no row then show nothing in datagrid1
it can run but waste lots of time on it....
can anyone tell me a better way to get it?

For Each dgitem In DataGrid1.Items
directNo = dgitem.Cells(0) .Text
DataGrid2.DataS ource = GetChildrenData Set(directNo)
DataGrid2.DataB ind()
If DataGrid3.Items .Count = 0 Then
dgitem.Cells(6) .Text = ""
End If

Next

Is the method i use correct?
Thanks for teaching me...
Aug 1 '08 #1
1 2125
Frinavale
9,735 Recognized Expert Moderator Expert
I don't know if this can help you but there is a TreeView Control available for ASP.NET developers....l ook into it....
-Frinny
Aug 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2446
by: ±èµ¿±Õ | last post by:
Tell me why the symbol "_" use in the Library? For example, char *_itoa( int value, char *string, int radix ); But We use function "itoa(value,string,radix) "only. I want to know the specific reason .
0
1090
by: tommy | last post by:
hello everybody, i haved read a few articles about, how to create controls in asp.net dynamically! i have tested it -- all works fine.... but....now it comes--> HOW create controls dynamically using a html-table.... i want to display dynamically on each row one button, and dont use datagrid.
15
28820
by: Bjorn Jensen | last post by:
Hi! An beginner question: Pleas help me with this (-: Error (the arrow points on the s in sqrt) ===== tal.java:6: cannot find symbol symbol : method sqrt(int) location: class tal System.out.println(i + ": " + sqrt(4));
7
3110
by: JustBeSimple | last post by:
Hi Everyone, I'm having a problem compiling useing the VS2005 .NET I need help to resolve those error, I try to create a new project it doesn't help any suggestion? I got the following errors: vector_main.obj : error LNK2019: unresolved external symbol "public: __thiscall Vector<int>::~Vector<int>(void)" (??1?$Vector@H@@QAE@XZ) referenced in function _main
3
8208
by: kartik369 | last post by:
hi while compiling my code im getting these errors: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(4729): error C2872: 'FILETIME' : ambiguous symbol could be 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinDef.h(354) : _FILETIME FILETIME' or 'stdafx.cpp(0) : System::Runtime::InteropServices::FILETIME' can anyone let me know how to resolve this...
0
1987
by: Nilam2477 | last post by:
I have an application which is converted from VC6 to VC7.1 (.net 2003) I'm trying to debug in .net 2003 i need to check the return value HRESULT value. I have declared hr as HRESULT hr = S_OK; When i add "hr" in watch window it displays a message CXX0017: Error: symbol "hr" not found When i try to set the cursor on HRESULT hr = S_OK line (using Set Next Statement) it does not execute that line. Could you please let me know what could be...
10
1173
by: =?Utf-8?B?U3RldmUgQmVobWFu?= | last post by:
Where can I find a discussion of the operator (or is it a keyword?) "^"? Doesn't have any relationship to the "&" in C++?
1
3755
by: RN1 | last post by:
Sub Page_Load(........) If Not Page.IsPostBack Then Call LoadData() End If End Sub Sub LoadData() Dim dSet As DataSet Dim sqlConn As SqlConnection Dim sqlDapter As SqlDataAdapter
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.