.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

Setting the SelectedIndex doesn't seem to be working

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :WPF
At least, it doesn't seem to work the way I would expect it to work, for the ComboBox.  Here's what I'm trying to do.  This is in a WPF 4.0 application, which I've made a page-oriented application.  (Not an XBAP app.)  On the first page the user enters a search criteria in an effort to find a client.  If they find a client, then the select that client and go to the second page.  If they don't find the client, then they still go to the second page, but they enter all of the information for a new client.  What I've done, with the second page is, with it's class constructor I'll pass in various parameters to indicate whether or not I'm working with a new client, or an existing client.  The majority of the time we're working with existing clients. It is the case where it is a new client that I'm having trouble.  On the second page there are several combo boxes, all of which I populate from lookup tables out of SQL Server.  All of the combo boxes are giving me the same problem/behavior, so it doesn't really matter which one I talk about.  Basically, for new clients, I want to set a pre-defined value for these combo boxes.  So, what I've done is in the second page's load event I'll set the SelectedIndex to the value our business has defined as the primary value, for new clients, for the various fields tha

View Complete Post

More Related Resource Links

Datalist doesn't appear to be working

I am trying to get a datalist to work, so I can use it as a menu. This is a learning experience for me, and would like to figure it out. I sort of used the TimeTracker as an example. Anyway, I build the ArrayList as the DataList datasource, but it doesn't work. So I put in a DataGrid, and copied the setting and binding of the datasource, and it works. I'll copy the page_load code to show how I'm doing this. I'm not including the TabItem class, but it appears to be working, cause it works for the DataGrid. Can anyone explain what is going wrong. When I try to used the DataList, I get the following error in the browser:

Object reference not set to an instance of an object.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

And the following line is highlighted red:
Line 58: tabs.DataSource = menuItems;


public abstract class Banner : System.Web.UI.UserControl
protected System.Web.UI.WebControls.DataList tabs;
protected System.Web.UI.WebControls.DataList MenuList;
//protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Web.UI.WebControls.Image Image1;

private void Page_Load(object sender, System.EventArgs e)

property setting in report server (2008) config file is not working as expected.



I have set the <WorkingSetMinimum> property to 2.4GB in my reportserver 2008 config file.

By defintion, <WorkingSetMinimum> setting means,

  1. Lower limit of service memory consumption; memory will not be released if the consumption is below this amount, though the service will not reserve the designated amount of memory when it starts.
  2. If service uses more than the designated amout of memory, it will release back the memory only till this declared value and not beyond that, which means it should keep 2.4GB as designated.

See this link for definition: http://books.google.com/books?id=mzY_Xo_9J-gC&pg=PA589&lpg=PA589&dq=What+is+%3Cworkingsetminimum%3E+in+report+server+configuration+file&source=bl&ots=r_xhRp8erj&sig=E_o0-Dh2SXOgMNrW3sptt5oZrYI&hl=en&ei=f5mjTNeNM5O8ccmErJMI&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCAQ6AEwAw#

Need help setting up a Custom Security Trimmer, CheckAccess method not working.


I'm implementing the custom security trimmer for SharePoint server as outlined here: http://msdn.microsoft.com/en-us/library/ee819923.aspx

I have been able to successfully deploy the solution on to the server, but know I need to write the script that will check whether users have access to particular documents or not. The code in the walk-through is the following:

public BitArray CheckAccess(IList<String> documentCrawlUrls, IDictionary<String, Object> sessionProperties, IIdentity passedUserIdentity)
            BitArray retArray = new BitArray(documentCrawlUrls.Count);
            //Use passedUserIdentity to get the identity of the user who issued the query.
            IClaimsIdentity claimsIdentity = (IClaimsIdentity)passedUserIdentity;
           //IClaimsIdentity is defined in Microsoft.IdentityModel.Claims;
            for (int x = 0; x < documentCrawlUrls.Count; x++)

Why doesn't the Windows authentication working?


I'm trying to write a simple ASP.NET 4.0 app, using Windows authentication to login.  This is on my peer-to-peer home network.  When I click to login, it instantly shows my Windows identity, so it looks as though I don't even need to login, as it's already done that for me.  However when I then go to any other page in the app, it looks as though I'm not logged in.

Why is that and how do I fix it? 

Setting ZIndex of grouped ListViewItem doesn't bring ListViewItem to top

I created this simple example to show what I am trying to support in my application. If you run this and hover over one of the listview items in the middle column, it will not be brought to the top and is partially covered by the items in the column to the right.

I'm setting the ZIndex on that ListViewItem, why is not brought to the top? I'm thinking the grouping is part of the problem, but I'm not sure how to fix this. Any suggestions would be great!

<Window x:Class="MRBListViewSample.MainWindow"



Working with SharePoint document libraries

Document libraries are collections of files that you can share with team members on a Web based on Microsoft Windows SharePoint Services. For example, you can create a library of common documents for a project, and team members can use their Web browsers to find the files, read them, and make comments. Users with Microsoft Office 2003 can check out and edit the files as if they resided on a local or network drive.

By default, your team Web site comes with a built-in document library named Shared Documents, which is listed on the Quick Launch bar as well as on the Documents and Lists page.

Working with DropDownList and ListBox Controls in ASP.NET

"In my application i am using dropdownlist to display all categories from a table. When the user clicks this control I display all records in that category. Category table also contains column called color.

I wanted display some categories in dropdown list different color and others in different color using ASP.NET."-Anonymous

Server side validation of Fileupload control not working



I've tried this method in my code behind to try and validate that the Fileupload control has a file or not. I get the error message the the event "Server Validate" cannot be found. Can anyone tell why? Thanks.

Public Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate

' Get file name

        Dim uploadAvatar As FileUpload = DirectCast(AdvertisementForm.FindControl("uploadAvatar"), FileUpload)

        Dim UploadFileName As String = uploadAvatar.PostedFile.FileName

        If UploadFileName = "" Then
            ' There is no file selected
            args.IsValid = False
            Dim Extension As String = UploadFileName.Substring(UploadFileName.L

Setting the default start page in godaddy hosting?


 How do you set the start page with godaddy hosting? I can see no way of doing this! You do not seem to have access to the IIS settings that allow you to change it!

Row command working on all rows not selected one?



I have this code that hides a column in a gridview.  (The column houses another nested gridview).

    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
        If e.CommandName = "Select" Then
            If GridView1.Columns(0).Visible = False Then
                GridView1.Columns(0).Visible = True
                GridView1.Columns(0).Visible = False
            End If
        End If
    End Sub

The trouble is that if I click the select link on one row that action to hide is carried out on all rows.  How can I set this up so that it only hides the row that is selected?


upload file not working



iam using masterpage and ajax update panel, i have child page called  fileupload.aspx,i try to upload the file

but its not working , can i use updatepanel in child page , pls very urgent

looking forward for answer.

Beginner: this doesn't make sense to me


Do you need and "empty" script tag in the head to run scripts that are in the body?  Also, can you run JQuery scripts if they're in the <head> tag?  The first sample only works if the JQuery script is in the form (and body) tag, not in the head - even if I add $(document).ready(function() { });

This works

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
<script type="text/javascript">
<form id="form1" runat="server">
<a href="">Here is a link</a>
<script type="text/javascript">
$('a').click(function () {
alert("you clicked me!");


This doesn't work.  Notice I removed the second <script> tag from the head

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="serve

JQuery Treeview plugin is not working with Ajax page load in ie8


Hi there,

I developed a page where i m using jquery treeview plugin to generate tree. It worked fine on FF, IE8 with out ajax.

But when my page loads thro' ajax call in IE8, it is not collapsing or expanding tree.

Any idea?

Thanks in advance.

jquery confirm windows isn't working


Hi, i am using jquery to implement a modal confirm windows but it not working

i have a template field button with ajax confirm using jquery but i have a problem. Apper the confirm windows but when i click on "yes" doesn't execute the delete command. without ajax (using template field button and simple confirm windows javascript) works so well.

Can you give me a hand with this?

thx in advance!

<link href="_assets/css/StyleSheet.css" rel="stylesheet" type="text/css" />
<link href="_assets/css/confirm.css" rel="stylesheet" type="text/css" />
<script src="_assets/js/jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="_assets/js/jquery.simplemodal-1.1.1.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function() {
       $(".deleteCustomer").click(function(ev) {
                var msg = $(this).attr("title");
                confirm(msg + "?");

Setting Screen Resolution



  I am developing a website in asp.net.How can i make my web pages view same in different screen resolutions.I am using 1024*768 resolution

Keyboard shortcuts stops working in WebMatrix


I'm often experiencing that keyboard shortcuts stops working in WebMatrix. This is very annoying as CTRL-S, CTRL-C, CTRL-V, etc. stops working, all of which are heavily used when programming. It's obviously hard to explain how to reproduce this, but I was wondering if someone knows a quick-fix?

Error while setting up application on Win7 using Visual Studio.NET 2003


Hi All,

Getting the below error while setting up application on Win 7 using visual studio.NET 2003.


cannot find the components for communiacting with the front page server extensions...


I understand by the error, i need to install Front page server extension, but not able to figure how to install using IIS 7.5.

I had XP machine with IIS 5.1, able to find the option.


Need your help in resolving this.




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