.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Multivalue parameters - Changing label if (Select All) is selected

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :Sql Server
I'm using SSRS 2005.  I have a report which has a multi value parameter.  When you click (Select All) the text in the parameter combobox shows all the names of the possible values.  Since this is my default it really looks tacky and hard to read. Is there a way I can have the text in the multi value parameter combobox say "ALL" or something else when (Select All) is checked?  

View Complete Post

More Related Resource Links

Changing select parameters.


It seems like this would be fairly straight forward.  I've got a gridview that loads up using one stored proc, but I've got a searchbox to filter the grid, and when the user enters some criteria I want to use a different proc to return the results.  Something tells me I should be doing this with one procedure, but I can't seem to make that work either.

When the form loads, my grid is populated.  And if I leave my search criteria blank and search anyway, my grid is still populated correctly.  But if I enter search creteria, I get diddley squat.  What gives?

Here is the relevent snippets. 


<asp:Panel ID="pnlSearch" runat="server" DefaultButton="btnSearch">
    Search:<asp:TextBox ID="txtSearch" runat="server" />
    <asp:Button ID="btnSearch" runat="server" Text="Go" Click="btnSearch_Click" />

<asp:SqlDataSource ID="sdsCustomers" runat="server"
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="<%$ Connectionstrings:ConnectionString.Providername %>"

Treeview: Select all children if Parent is selected etc...



I'm using a Treeview with  ShowCheckBoxes="All" , so basically I have a tree with all CheckBox Nodes. I'm using the TreeView inside an update panel, and populate the Tree code behind dynamically.

My requrements are the following:

1) Select all the children if parent is selected,

2) When parent is selected, and if we de-select a child, set parent unselected

3) Track if new nodes were selected and previously selected nodes were de-selected (becasue I need to update the database according to the selections in the Tree)

For above 1, I do the following:

protected void TreeView1_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)
        foreach (TreeNode node in TreeView1.Nodes)
            TreeNodeCollection col = node.ChildNodes;
            //select all children when the parent is checked
            if (col != null && node.Checked)

how can i display the selected value of dropdownlist from edittemplate to label from itemtemplate?


I have a detailsview with a dropdownlist in it. the detailsview is connected to a database table(employees having the following fields: id-smallint,name-nvarchar, departmnet-smallint). the ddl is connected to another table (departments with the following fields: id-smallint, departmentName-nvarchar). the ddl is in the edititemTempalte of the department field. My goal is to display in  the itemtemplate the departmentName (the selected value from the edititemtemplate ). How can I do this? Doyou have any ideas?

thanks a lot

setting label using modalpopup selected value


Hi all:

I have a modalpopup control which has  a gridview and search criteria. User selects a records and clicks modalpopup ok button ( which is set as modalpopup's okbutton). I have attached an event to okbutton click event. and inside this event, I am setting a label control which in on main page which called this modalpopup. I debugged code, it comes inside that event but doesnt set value. below is my event code.

protected void btnOkCustomers_Click(object sender, EventArgs e)


Int32 CustomerID = Convert.ToInt32(GridView2.SelectedDataKey.Value);

orders = new Orders();

DataSet CustomersDs = orders.GetCustomerById(CustomerID);

lblCustomerName.Text = "sadasdad"; // CustomersDs.Tables[0].Rows[0]["first_name"].ToString();




Please suggest me solution to this.

Asif Hameed

NULL label doesn't appear on drop down or multi-select parameter.

Hi, I am using SSRS 2005 SP3. I have the following query that I use for my parameter: SELECT 0 AS c1, 'NOT Specified' AS c2 UNION SELECT 1 AS c1, NULL AS c2 UNION SELECT 2 AS c1, 'Test 1' AS c2 UNION SELECT 3 AS c1, 'Test 2' AS c2 Let's call my parameter prm1. The type of prm1 is string and it has "Allow null value" and "Allow blank value" options ticked. C1 is the value field and C2 is the label field for prm1. When I preview the report, and I didn't see NULL in my drop down list,  but that record has been shown as 1 (which is the value). I am wondering if this is a normal behavior of SSRS? It's not a big deal. I can replace NULL with something else, but I am just curious. Cheers, Uzzie

LinqDataSource set parameters of select programatically

Hello, I have one SP that receives a parameter.That parameter is not going to be a textbox, dropdown, etc.Its going to be a session variable and not viewable on thee User Interface.Can somebody please tell me how can I set that parameter programatically with linqdatasource or dynamic data thx

sql select results to messagebox/label

For example I want to get the price of a particular item from table items. I created the connection string and the cmd for the search and put the result in an sqldatareader. How do I put the result in a string so I can use it later?   Code so far of what I've done: (Code is in Vb.net) Dim conn =   conn As SqlConnectionNew SqlConnection("Data Source=Computer\SQLEXPRESS;Initial Catalog=database;User ID=id; password=password") Dim cmdSelect As New SqlCommand("SELECT Price FROM Items WHERE Code = Item1, conn)   conn.Open() dtrReader = cmdSelect.ExecuteReader While dtrReader.Read lblPrice.Text = dtrReader.GetDouble(0).ToString End While   dtrReader.Close() conn.Close()   Instead of the price the table is left empty.  

Problem with SELECT COUNT query and parameters

Hello!I have a problem with SELECT COUNT query in ASP.net. I want to create CMS with articles which have categories (which have the option to be deleted). The problem is that I want to get the number of articles within the specified category so if there aren't any articles with the specified category I can proceed with the category deletion.I have the following code:protected void Page_Load(object sender, EventArgs e) { } protected void GridViewKategorije_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Uredi") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow odabraniRed = GridViewKategorije.Rows[index]; TableCell ClanakID = odabraniRed.Cells[2]; string ID = ClanakID.Text; Response.Redirect("/Portal/Administracija/Kategorija.aspx?idKategorija=" + ID); } else if (e.CommandName == "Obrisi") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow odabraniRed = GridViewKategorije.Rows[index]; TableCell KategorijaID = odabraniRed.Cells[2]; String connString = WebConfigurationManager.ConnectionStrings["CMS"].ToString(); SqlConnection conn = new SqlConnection(connString); conn.Open(); using (SqlC

how to Remove a check box whick label is Select All in jquery


how to remove checkbox and its label

<input type="checkbox" name="CheckBoxBind$0" id="CheckBoxBind_0">

<label for="CheckBoxBind_0">Select All</label>

Values in multiselect dropdown not getting selected when Select All option is selected


Values in multiselect dropdown not getting selected when Select All option is selected for a SSRS dropdown.

There are multiple dropdowns on the page. We have one dropdown whose output is being used to populate the second dropdown using a stored procedure. When we check the Select All checkbox on the dropdown then ideally upon page refresh all the values should get selected in the dropdown, but in this case the page refreshes back to the blank dropdown, forcing the user to select the values again. The next dropdown too does not get populated. This makes it impossible to run the report for all the cases by using Select All.

We ran the report on differnet database environments. My current location is Mumbai,India, the report worked fine when we ran it on a Bangalore,india database. This issue occurs when we try running it on a Chicago database server.

I am using SSRS 2005, SQL2005.

If anybody has faced such an issue earlier, please help me out here.  Thank you. 


Linked Reports - Multi-Select Parameters


I have searched for this but have not found any answers, or similar questions even. I have a report with several multi-select parameters. These parameters are populated by datasets that use stored procedures. When I go to "Properties" and "Parameters" of the linked reports, they do not populate the drop-down menu for the parameter, the parameter is simply blank and has an area for me to manually type in data. Is there any way to force these parameters to populate with a selectable list of options? Like would occur when running the report from the front-end interface, or setting up a subscription.


selected option items in (multi-) select box on ASP pages are not highlighted if the select box is d


Dear community,

I've an asp application with vbs using input forms containing select objects with the property "multiple" specified. If the select object is disabled, the selected option items aren't highlighted. This behaviour occurs with IE8 and also with IE9. In earlier versions of IE everything worked fine. You can reproduce that also with a simple HTML page like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<Select style='width:200;height=200' disabled multiple>
 <option selected>option1</option>
 <option selected>option3</option>
 <option selected>option5</option>

<Select style='width:200;height=200' multiple>
 <option selected>option1</option>
 <option selected>option3</option>
 <option selected>option5</option>



Is there a workaround for that?

Thanks in advance!


SSRS cascading parameters always select all


I have 4 paramters that are cascading(the last parameter depends on the one before that and that one depends on the one beofore that etc.) The are all multivalue with a select all option.

When I click 2 options in my first parameter all values in the list below that get checked. This is good. Now when I click an extra value in my first parameter in the parameter under this the new values show up but they do not get selected. Is there a way to always select all in all parameter lists?



How to add Select Control parameters in Code Behind


I have a need to add my page controls dynamically in code behind.

I do well, adding a dropdownlist, a SQL datasource to populate it, setting it to autopostback=true, and adding a gridview and its SQL datasource.

What I'm unsure about is how to programmatically refer to the SelectParameter, being a control (the DropDownList), and its selected item.

any ideas? 

select record based on / match selected date

with the sql statement below, i try to select the records based on the selected date, it return no rows from adapter filled datatable. 
however, when i run the query in sql query in sql server studio management, it returns records. 
date format = 09/28/2010

string[] splitDT = txtSelectedDate.Text.Split('/');

            string strRearrangeDT = splitDT[0] + "/" + splitDT[1] + "/" + splitDT[2];

using (SqlConnection sqlconn = new SqlConnection(connstring))
                DataTable dt = new DataTable();
                string strSQL = "SELECT userclaim_details3.id, userclaim_details3.userclaimid, userclaim_details3.userid, userclaim_details3.childcategorytableid, userclaim_details3.statusid, " +
                         "userclaim_details3.amount AS amountname, userclaim_details3.remark AS remarkname, userclaim_details3.datecreated AS datecreatedname, " +
                         "userclaim_details3.datemodified, approvaltable.id AS Expr1, approvaltable.typename AS statusname, usertable2.id AS Expr2, usertable2.name AS uname, " +
                         "childcategorytable.id AS Expr3, childcategorytable.categor

changing Asp.net Gridview's cell from Label to edit mode in code behined file


 Hi all,

In my asp.net application i'm using gridview to which i'm binding data dynamically by writing a select query in code behined file (all column's are autogenerated) now i want to change gridview cell to edit mode from label to textbox or dropdown on clicking of gridview's cell.How can i achive this in code behined file.

thanks in advance

Select all parameters and include them in a subreport - How do I select all parameters?


Hi all,

I have learned from http://social.msdn.microsoft.com/forums/en-us/sqlreportingservices/thread/8EB22B50-B752-46F1-9574-53A3FBED4FA1 that I can show the selected parameters in a report.

This is great, but I am thinking about to develop a more structural solution. My goal is at every report a seperate page which shows the selected reports. So, I would like to include a subreport in every report which automatically selects all parameters and their filled in values.

Now my question: How do I select all parameters?

Thank you in advance,


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend