Click here to Skip to main content
15,897,273 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Confirmation Message Box in Code Behind Asp.Net Pin
priyagee16-Dec-10 19:33
priyagee16-Dec-10 19:33 
QuestionRe: Confirmation Message Box in Code Behind Asp.Net Pin
Hiren solanki16-Dec-10 20:03
Hiren solanki16-Dec-10 20:03 
AnswerRe: Confirmation Message Box in Code Behind Asp.Net Pin
priyagee16-Dec-10 20:53
priyagee16-Dec-10 20:53 
AnswerRe: Confirmation Message Box in Code Behind Asp.Net Pin
Hiren solanki17-Dec-10 3:04
Hiren solanki17-Dec-10 3:04 
GeneralRe: Confirmation Message Box in Code Behind Asp.Net Pin
PunkIsNotDead17-Dec-10 7:11
PunkIsNotDead17-Dec-10 7:11 
QuestionConverting Linq to Sql query to Linq to entity Pin
Swiftain16-Dec-10 14:24
Swiftain16-Dec-10 14:24 
AnswerRe: Converting Linq to Sql query to Linq to entity Pin
Swiftain16-Dec-10 15:07
Swiftain16-Dec-10 15:07 
QuestionCreate listviews at runtime (dynamic) with checkboxes Pin
r_raman9916-Dec-10 6:44
r_raman9916-Dec-10 6:44 
I need your help guys ...


I have a Listview which contains application names.Multiple items can be selected in it.Now depending on the number of selections made,I have to list all their related testcases in seperate listviews(1 listview for each selection made).

Also the testcases should be come in the listviews in a checkbox format.

So I feel depending on the no. of selections made ,I need to create listviews at runtime(dynamic) and then fill them up with testcases which need to be in a checkbox format.


But I am stuck as to how to create dynamic listview and fill it up.I am not a very experienced coder.

Req doc is like this

· Once the user selects an application a table with all the test cases associated with that application gets displayed.
· If the user checks the check box against the application name then all test cases will get selected.
· Else he can choose specific test cases by checking the check boxes beside the test cases.


My code for 1 listbox selection is as follows and working f9.But this is a satic listview as only one item can be selected.Now the requirement is for multiselect so the situation has changed and I cant use this approach.

Aspx page contains following code:
<asp:Panel runat="server">
<asp:CheckBox runat="server" AutoPostBack="True" Text="Select All" Visible="false"/>
<asp:ListView runat="server" >
<LayoutTemplate>
<table border="1" >
<tr runat="server">
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr id="Tr1" style="font-size: small">


<td>
<asp:CheckBox runat="server" Text='<%# Eval("TestCaseName") %>' Value='<%# Eval("TestCaseID") %>'>

</asp:CheckBox>
</td>
</tr>
</ItemTemplate>
</asp:ListView>
</asp:Panel>


Code Behind is as follows:

protected void lbSelectApplications_SelectedIndexChanged(object sender, EventArgs e)
{
int cobrandId = Convert.ToInt32(ddlSelectCobrand.SelectedValue);
int appid = Convert.ToInt32(lbSelectApplications.SelectedValue);
if (appid != -1 && cobrandId != -1)
{
BusinessLogicLayer.BusinessLogic obj = new BusinessLogicLayer.BusinessLogic();
testcasedataset= obj.GetActiveTestcasesForSpecificCObrandedApplication(appid, cobrandId);
listView2.DataSource = testcasedataset.Tables[0];
listView2.DataBind();
listView2.Visible = true;
chkall.Text = lbSelectApplications.SelectedItem.Text.ToString();
chkall.Visible = true;
for (int i = 0; i < testcases.Tables.Count; i++)
{
ListView lv = new ListView();
//here dynamic creation of listview code should go

}

protected void chkall_CheckedChanged(object sender, EventArgs e)
{

for (int i = 0; i < listView2.Items.Count; i++)
{

CheckBox chk = (CheckBox)listView2.Items[i].FindControl("chkTest");

if (chkall.Checked == true)
{

chk.Checked = true;

}

else
{

chk.Checked = false;

}

}

}


}

Pls I need ur help.Please advise how to go about itand if you have a better alternative do let me know.

thanks
AnswerJust a TIP Pin
Hiren solanki16-Dec-10 18:54
Hiren solanki16-Dec-10 18:54 
QuestionIIS / Development Server Pin
Jammer16-Dec-10 3:34
Jammer16-Dec-10 3:34 
AnswerRe: IIS / Development Server Pin
scottgp16-Dec-10 4:21
professionalscottgp16-Dec-10 4:21 
GeneralRe: IIS / Development Server Pin
Jammer16-Dec-10 4:32
Jammer16-Dec-10 4:32 
QuestionWebServices in several servers Pin
Dirso16-Dec-10 3:01
Dirso16-Dec-10 3:01 
Questionhow can i debugging asp in visual studio2005? Pin
buffering8315-Dec-10 22:41
buffering8315-Dec-10 22:41 
AnswerRe: how can i debugging asp in visual studio2005? Pin
Hiren solanki15-Dec-10 23:13
Hiren solanki15-Dec-10 23:13 
AnswerRe: how can i debugging asp in visual studio2005? Pin
5fingers16-Dec-10 0:56
5fingers16-Dec-10 0:56 
Questionvisual studio 2010 , error j# Pin
buffering8315-Dec-10 19:42
buffering8315-Dec-10 19:42 
AnswerRe: visual studio 2010 , error j# Pin
Hiren solanki16-Dec-10 0:53
Hiren solanki16-Dec-10 0:53 
GeneralRe: visual studio 2010 , error j# Pin
5fingers16-Dec-10 0:58
5fingers16-Dec-10 0:58 
QuestionOutlook web App customization Pin
stambekar15-Dec-10 19:40
stambekar15-Dec-10 19:40 
QuestionPDF File not getting displayed on MVC View Pin
Praveen_S15-Dec-10 18:07
Praveen_S15-Dec-10 18:07 
AnswerRe: PDF File not getting displayed on MVC View Pin
Not Active16-Dec-10 2:15
mentorNot Active16-Dec-10 2:15 
Questiongauge control Pin
venu65615-Dec-10 0:57
venu65615-Dec-10 0:57 
AnswerRe: gauge control Pin
NeverHeardOfMe15-Dec-10 1:09
NeverHeardOfMe15-Dec-10 1:09 
GeneralRe: gauge control Pin
venu65615-Dec-10 2:09
venu65615-Dec-10 2:09 

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.