.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

DataGridComboBoxColumn - Auto drop down on single click

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :WPF

I have a DataGridComboBoxColum in a DataGrid.
I would like to be able to click on the cell one time and have the combobox drop down.
Currently you have to click multiple times.

How is this done?

  DisplayMemberPath="{Binding Path=color}" 
  SelectedItemBinding="{Binding Path=color}" 
  Width="Auto" MinWidth="100" 

View Complete Post

More Related Resource Links

Cascading drop box holds old value if empty on auto post back

I have 3 drop boxes: 1.) Choose Operation 2.) Choose Site 3.) Choose Area. All three of them are linked to an SQL server database which has 3 tables following the same heiarchy of order. I.e. Areas belong to a Site and Sites belong to an operation. And there can only be one operation per site, or one site per area. First you select an operation, then the page auto postbacks to filter the sites. Then you pick a site and again it autopostbacks to filter the areas. The issue I am having is that when an associated operation has no sites underneight it, and therefore no areas under that, the previous values that were in the boxes are displayed and the user can't click on the boxes anymore. I think this is kind of cheap looking and would like a way to make it so the boxes are clear (i.e. nothin in them). Is there anyway to check if they are going to freeze like that and assign them blank values??Any suggestions on this issue would be greatly appreciated!-Jordan

How to prevent combobox drop down from expanding on double click

Hi, I have a requirment to toggle the selected item of a combobox on double click. I am able to achieve this using MouseDoubleClick event for combobox. But the issue is, when I double click the popup for the combobox also drops down, which I need to avoid.   How can I do this.   Please help.   Thanks, P

Datagrid checkbox check uncheck in single click

Hi, I have a datagrid colums of checkbox type. Users have to click twice on the checkbox to check or uncheck. Is there a way to do this in one click. Thanks Vijay

Insert/Update data to multiple tables on a single button click


Hi experts,

I need to insert/update data to 3 or more tables on a single button click.What is best method for achieving this?I am using mysql as my DB.

Thanks for your valuable reply in advance.

Single Click File Upload with Preview and no heartache


Combing the web for a simple file uploader for ASP.NET with a server side save and preview capability didn't reveal anything simple, and I noticed a lot of people were struggling to get something too.

I figured this example out today. It uses existing techniques and is simple. Downside is that you have to use session for the temporary store, and the Ajax AsyncFileUpload usess session too.

Written in VS 2010 - I hope you find it useful. This is the basic working code - that should easily be exandable even for more demanding requirements such as  Repeater controls etc.


<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="FileUploader._Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <script type="text/javascript">
        function uploadComplete() {
            requestImgUrl("", "");

        function dataFromServer(imgUrl) {
            document.getElementById("Image1").src = imgUrl;

cascading drop down lists from single table


my one table consists of fields (id, flying from, flying to). thus i have one drop down for flying from and another drop down for flying to. i'm hoping to cascade them so 2nd drop down values are dependant on the values from 1st drop down. is it possible to do this using a single table? or must i use two tables and link the id's from both? and do i write anyting in the SelectedIndexChange event? thanks...

the sqldatasource code looks like this:

Flying From:

        <asp:DropDownList ID="ddlFlyingFrom" runat="server" DataSourceID="SqlDataSource1"
            DataTextField="FlyingFrom" DataValueField="Id" AutoPostBack="True" OnSelectedIndexChanged="ddlFlyingFrom_SelectedIndexChanged">

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
            SelectCommand="SELECT [Id], [FlyingFrom] FROM [Flights]"></asp:SqlDataSource>

Button On client click event Loads Drop Down List


Hello All


Right now my ASP page has a text box and a submit button, what I am trying to do is once the user hits the submit button load a drop down list.


The drop down list should not be visible before the submit button is pressed


Thanks in advance 

Auto click Literal Control on Form Load


Hi Everyone,

          How can one Auto click a Literal Control button on Form Load???

Activate Form/Process menustrip or toolstrip control with Single Click


I am trying to make my form process the form activate and the ToolStrip or MenuStrip selection with a single click.  Currently, if a form does not have focus and you mouse over the ToolStrip or MenuStrip options they highlight like you can click them.  Only you have to click once to activate the form and again to activate the option you are over.  Does anyone know of a way to do this in a single click?


I have found this as a solution http://www.codeproject.com/KB/menus/UpgradeToMenuStrip.aspx?msg=2615988.  It does work however; it breaks the C++ form editor.  Is there another way to do this?


Thank You

Is it possible to add the drop down edit menu that appears from a single page to the page edit toolb


I am running Sharepoint 2007 and wondered if it is possible to add the "edit" drop down menu that appears from a single page—the one that contains edit properties, check out, publish a major version, etc—into the page edit toolbar, which is the one that contains the page, workflows, and tools drop downs.  I found the article that provided the code to add a "links" menu and quick buttons, but didn't know if it was possible to add the edit menu or, if so, what code would be necessary.

The reason I want to add it is for page creators to be able to access that menu's options without having to first navigate back to the pages library.

Thanks in advance!

Auto email myself on button click



I downloaded the code from the asp.net training video on sending email from a website. I copied and pasted the code.  My goal is to simply send myself an email when someone places an order on my site.  I'm getting the following error:

Exception Details: System.FormatException: The specified string is not in the form required for an e-mail address.

Source Error:

Line 16:     Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Line 17:         'Create instance of main mail message class.
Line 18:         Dim mailMessage As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage()
Line 19: 
Line 20:         'Configure mail mesage

My code behind looks like this:


  'Create instance of main mail message class.
        Dim mailMessage As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage()

        'Configure mail mesage
        'Set the From address with user input
        '    mailMessage.From = New System.Net.Mail.MailAddress(txtFromAddress.Text.Trim())
        'Get From address in web.config

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Application Architecture in Windows Forms 2.0-Single-MDI Applications

Consider an MDI application like Microsoft Excel; files opened from the file system (by double-clicking) are all opened as separate child windows within the parent Excel window.7 For the first instance of an MDI application to open a new child window to display the file that was passed to the second instance of the application, the second instance must be able to communicate with the initial instance.

GridView Javascript Click Row and Ajax

This article shows 2 common tasks with the ASP.NET GridView: Binding a List (generic) of objects as DataSource and on clicking a row, getting the values of the selected row by a javascript function. In the example a List with User-objects is displayed. On clicking a row containing the data of a User-object, the Id of the object is used to get the address of the user by an Ajax-call and display it in a details-field.

>>>How to update multiple rows of gidview by one click



I want to add multiple rows of a gridview if the data for multiple fields are same.

Idea for this is that a user may search a record with some parameter e.g. Sector, plot.

For example 15 records being displayed in gridview.

There should be checkbox before every row and if user wants to update Plot and Flat No that is same for 10 rows out of 15 so he will check the rows and update.

For this a dialog box should appear asking for the parameter i.e. Plot and Flat or something else next time may be it will be City or country. Moreover, there is already an Edit button to update records, when user click it another page open for the record to be updated and whatever he wants to update, it updates.

Hope everone understand the scenario.

I don't want to disturb the already provided Edit functionality and want to provide same record to be updated.

Any idea in this regard would be appreciated.

jquery anchor click


looking for confirmation that using jquery to click an <a> element does not simulate the click of the link like it does in the object returned by getElementById.

<a id="anchor1" href="http://www.google.com">google</a>

// this does not click the link.
var x2 = $('#anchor1');

// this does click the link.
var x3 = document.getElementById('anchor1') ;
x3.click( ) ;

// this syntax returns the DOM object for the anchor element which can be clicked to redirect to the link.
var x4 = $('#anchor1') ;
var x5 = x4[0] ;
x5.click( ) ;


merging multiple tables in a single dataset to single table


 i have a stored procedure which returns three tables to a dataset ..... now i need to merge all three tables to a single table from d same dataset 

like dataset1 has table1 table2 and table3 .... i want all the three tabels to be merged into dataset1 itself .... instead of three diffrent tables so that i can show all three table data in a single datagrid  as a compact data and combination of 3 tables from d single dataset.....

can some1 help me please.....

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