Click here to Skip to main content
15,911,360 members
Home / Discussions / C#
   

C#

 
AnswerRe: what we call Pin
Le centriste14-Sep-06 3:48
Le centriste14-Sep-06 3:48 
AnswerRe: what we call Pin
Judah Gabriel Himango14-Sep-06 5:08
sponsorJudah Gabriel Himango14-Sep-06 5:08 
QuestionDllImport and datatypes Pin
Le centriste14-Sep-06 3:36
Le centriste14-Sep-06 3:36 
AnswerRe: DllImport and datatypes Pin
V.14-Sep-06 4:11
professionalV.14-Sep-06 4:11 
QuestionDataGrid with Label + TextBox + Listbox Pin
nmandaliya14-Sep-06 3:09
nmandaliya14-Sep-06 3:09 
AnswerRe: DataGrid with Label + TextBox + Listbox Pin
Private_Void14-Sep-06 8:56
Private_Void14-Sep-06 8:56 
GeneralRe: DataGrid with Label + TextBox + Listbox Pin
nmandaliya14-Sep-06 22:10
nmandaliya14-Sep-06 22:10 
QuestionDataGrid with Label + TextBox + Listbox Pin
nmandaliya14-Sep-06 3:05
nmandaliya14-Sep-06 3:05 
Hi to all,
I am facing really strange problem. Could you please help me out from that?
LET me describe my requirement.
-------------------------------------------------------------------------------
We have list of "projects" which has some role like - PM, PL, TL, Developer, Tester etc. and absence of any of the person for the particular role, i have to assign other person, which has same role, in the project.
ie database is like this,
PM PL DEV TESTER
Project1 pml pl1 dev1,dev2 t1
Project2 pm9 pl10 dev18,dve20 t3,t10 etc..

PM = pm1,pm5,pm10,pm12 ect..
PL = pl1,pl11,pl10 etc...

so after setting back up of all projects, i have "save" button which save all the projects‘ back up in one table.
-------------------------------------------------------------------------
let's move on GUI...
I have one dropdownList - ddl which has roles (PM,PL,TL etc..)
and in datagrid i have 3 cols
1) Label - project name
2) TextBox - Person who is currently assign the role listed in dropdownList - ddl
3) ListBox - All the person who has same role in database listed in dropdownList - ddl

ie if i select TL in dropdownList, Datagrid shows,
1) all projects 2) person assign TL for the project. 3) all the person who are TL
I have a SAVE button which save all the projects backup at once.
------------------------------------------------------------------------------
To bind the Datagrid, i have use..
**************
<asp:label runat="server" id="name" text="<%# DataBinder.Eval(Container,"DataItem.Name")%>">
<asp:textbox text="<%# DataBinder.Eval(Container.DataItem,"Asigned Role") %>" id="AssignRole" runat="server">
Note - this two control bind by DataSet which returns “Project Name” and “Person Name”
***************
<asp:listbox runat="server" id="ddl1" datasource="<%# getallData1() %>" datatextfield="AllRoles" datavaluefield="AllRoles" selectionmode="Multiple">
this is i dynamically bind with function "getallData1" which retunrs DataTable with one column - All person who is TL.
---------------------------------------------------------------------------
On save button i wrote code like
***********************************
private void Button1_Click(object sender, System.EventArgs e)
{
ArrayList arr = new ArrayList();
foreach (DataGridItem dgi in DataGrid1.Items)
{
Label lb = (Label) (dgi.Cells[0].Controls[1]);
TextBox tb = (TextBox) (dgi.Cells[2].Controls[1]);
ListBox lb1 = (ListBox) (dgi.Cells[1].Controls[1]); arr.Add(lb.Text.ToString());
arr.Add(tb.Text);
for (int i=0;i < lb1.Items.Count;i++)
{
if (lb1.Items[i].Selected==true) arr.Add(lb1.SelectedItem.Text);
}
}

ListBox1.DataSource = arr;
ListBox1.DataBind();
}

-------------------------------------------------
Right now i want to list all items in LISTBOX1 which has FirstRow as Project NAme, SecondRow TL Name, ThirdRow Backup of TL / BackUp of TLs
---------------------------------------------------
So, main problem is that.. I can access Label – Project Name, TextBox – Person name. But I can’t access the selected Value of Listbox in DataGrid. It always gives me all items as deselected.

Can any one tell me how to get all the records which I selected in Listbox?

Thanks in advance.
Bye.
QuestionMSN Integration Pin
AB777114-Sep-06 2:58
AB777114-Sep-06 2:58 
Questionxmldocument question Pin
Yustme14-Sep-06 2:57
Yustme14-Sep-06 2:57 
AnswerRe: xmldocument question Pin
Stefan Troschuetz14-Sep-06 3:17
Stefan Troschuetz14-Sep-06 3:17 
GeneralRe: xmldocument question Pin
Yustme14-Sep-06 3:29
Yustme14-Sep-06 3:29 
GeneralRe: xmldocument question Pin
Stefan Troschuetz14-Sep-06 3:51
Stefan Troschuetz14-Sep-06 3:51 
GeneralRe: xmldocument question Pin
Yustme14-Sep-06 4:03
Yustme14-Sep-06 4:03 
AnswerRe: xmldocument question Pin
Hamid_RT14-Sep-06 9:46
Hamid_RT14-Sep-06 9:46 
Questionhow to copy a access database in c# Pin
faladrim14-Sep-06 2:43
faladrim14-Sep-06 2:43 
AnswerRe: how to copy a access database in c# Pin
Stefan Troschuetz14-Sep-06 3:20
Stefan Troschuetz14-Sep-06 3:20 
GeneralRe: how to copy a access database in c# Pin
faladrim14-Sep-06 3:31
faladrim14-Sep-06 3:31 
GeneralRe: how to copy a access database in c# Pin
Stefan Troschuetz14-Sep-06 3:58
Stefan Troschuetz14-Sep-06 3:58 
GeneralRe: how to copy a access database in c# Pin
faladrim14-Sep-06 4:04
faladrim14-Sep-06 4:04 
GeneralRe: how to copy a access database in c# Pin
Stefan Troschuetz14-Sep-06 4:11
Stefan Troschuetz14-Sep-06 4:11 
GeneralRe: how to copy a access database in c# Pin
faladrim14-Sep-06 4:16
faladrim14-Sep-06 4:16 
Questionproblem in form resizing Pin
kalaveer14-Sep-06 2:20
kalaveer14-Sep-06 2:20 
AnswerRe: problem in form resizing Pin
Not Active14-Sep-06 2:25
mentorNot Active14-Sep-06 2:25 
AnswerRe: problem in form resizing Pin
Andrei Ungureanu14-Sep-06 2:31
Andrei Ungureanu14-Sep-06 2:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.