I have a combo box that I need to make first item in list blank. Here is the code that loads the combo box: aAdaptor = new OleDbDataAdapter(aSQLQuery, aConnection); aAdaptor.Fill(aDataSet); cBox.DataSource = aDataSet.Tables[0]; cBox.DisplayMember = aDisplayName; cBox.ForeColor = Color.Blue; This code all works great, it loads the combo as I need. But I cannot figure out how to get the first item in the list to be blank. Would appreciate any ideas here. Thanks, Vern Vern
Vernware
Posts
-
Make 2st item in combo box blank -
How do I send an aspx file to a particular frame locationI am trying to execute a client side JavaScript function to send a page to a particular frame location. This is how I am doing it: On the page being loaded, I have the following form definition:
I need the LoadMenuBar function to execute (on the client). So I removed the runat=”server” property form the form element. Everything seems to run OK, except the LoadMenuBar function does not execute when the form is loaded. This is the LoadMenuBar function: function LoadMenuBar() { alert("Got Here"); window.parent.parent.DisplayMenuBar.location = "menu_bar.aspx"; return; } This script code is inserted in the page that gets loaded. I guess my question is, why is the LoadMenuBar function not being executed? Thanks, Vern
-
How do I send an aspx file to a particular frame locationThanks for the reply. Sometimes the easy answer is so easy you cannot see it. I will take your advise. Thanks again, Vern
-
How do I send an aspx file to a particular frame locationI am developing an application in asp.net and using C# for any code requirements. I am bringing an old ASP project over to asp.net. The old asp project used JavaScript for much of the coding. I am trying to perform a javascript function in the C# world. Here is the old JavaScript function: function LoadMenuBar() { window.parent.parent.DisplayMenuBar.location = "menu_bar.asp"; return; } This function would send the menu_bar.asp file to a frame segment named DisplayMenuBar. Here is the HTML code that defines DisplayMenuBar: My question is, how do I perform this same functionality in asp.net using C# as the code environment? Would be very greatful for any suggestions/help/etc on this issue. Vern
-
How do I communicate with a stored procedure?kryzchek: Thanks for the code. This code and other code I got from this site was very helpful. Thanks again, Vern
-
How do I communicate with a stored procedure?Ennis: Thanks for the tips. This wsa very helpful. Thanks again, Vern
-
How do I communicate with a stored procedure?I am developing a program using asp.net 2.0. I am using C# as the programming language. In this project I am connected to a SQLServer database (SQLServer 2005). I have created a stored procedure in this database and want to call it from C#, pass it some parameters and receive from it a return value. I am not clear as to how to call it, pass the parameters and then access the return value. I would appreciate any help/advise/suggestions/etc on this. Thanks, Vern Vern
-
How to upgrade from .NET 1.1 to .NET 2.0Thanks for the info. I went to these web sites and was able to get the tools I need. This was a great help. Thanks again. Vern
-
How to upgrade from .NET 1.1 to .NET 2.0Hi all: I am currently developing projects using (let me see if I can get this right) .NET Framework 1.1 which has C#, VB and ASP. I would like to upgrade to .NET Framework 2.0. My questions are: Where can I go on the internet to do this? I have spent hours cursing the internet and am completely confused. Will the .NET Framework 2.0 provide me with the tools I listed above (C#, VB and ASP). I really need these tools. Thanks in advance for help on this subject. And shame on Microsoft for making this simple upgrade process so complex. Vern
-
How do I cast a string to type System.Windows.Forms.MessageBoxButtonsLuc: Thanks for the response. I did finally end up using some code that used MessageBoxButtons and MessageBoxIcon variables. Thanks again. Vern
-
How do I cast a string to type System.Windows.Forms.MessageBoxButtonsChristian: Thanks for you response. The enum.Parse was a good tip. Thanks again. Vern
-
How do I cast a string to type System.Windows.Forms.MessageBoxButtonsIn C#: I am building the MessageBox parameter: MessageBoxButtons.OK from a string. The string is defined this way: string buttonSelected = “MessageBoxButtons.” + selectedButton; selectedButton is defined elsewhere in the program, lets say as “OK”. When I call MessageBox, I try to cast the parameter MessageBoxButtons like this: MessageBox.Show(“test”,”test”, (System.Windows.Forms.MessageBoxButtons) buttonSelected); I get an error that says I cannot convert type string to System.Windows.Forms.MessageBoxButtons. Why can’t I do this? Vern
-
Creating customized dialog boxesI do believe I know what your talking about. I remember working on a project where I know I had an event handler and one day it was just gone. Now I know it was not my imagination. Thanks again.
-
Creating customized dialog boxesEnnis: Thank you very much for your response. Calling InitializeComponenets in the constructor did the trick. I really appreciate your help. Vern
-
Creating customized dialog boxesOK, I am really stuck. I have a form with a button. I click the button and I want to display a dialog box. I created the dialog box using the age old inheritance stuff. That is: public class MySpecialDialog : System.Windows.Forms.Form I customize the form to my hearts content. Glory be. How simple can this be? But when I try do instantiate this customized dialog: private WindowsForms.MySpecialDialog aDialog; aDialog = new MySpecialDialog(); and then show the dialog in the button click routine: aDialog.ShowDialog(); I get a form that is just a blank form. Could someone tell me what I am missing here? Thanks in advance, Vern
-
Forcing a C# form Datagrid to repaintVandra: Thanks for the tip about the datagrid.Validate(). I put this in the Scroll event of the datagrid and this solved the problem I was having. Let me try to explain the problem I was having again: First I resize the datagrid so that the scroll bars show up. Then I scroll around the datagrid. Finally I resize the Datagrid so that it fills the screen. Now when I scroll again, the grid is messed up. Some columns appear twice, some don’t appear at all, its just really messed up. Anyway, when I put the Datagrid.Invalidate() in the Scroll event, all is well. Thanks again for your help. Vern Vern
-
Forcing a C# form Datagrid to repaintI am working in C#.net and have a Datagrid control. The grid seems to work ok except for a new problem I have noticed. When I resize the main form (and consequently the Datagrid) and scroll around the Datagrid using the forms scroll bars and then maximize the form and the Datagrid I notice that the Datagrid does not seem to repaint properly. The entire grid design is messed up. I suspect this may be a repaint problem. Somehow and somewhere I need to force the grid to repaint. I would appreciate any tips as to how and where I should do this. Thanks, Vern Vern
-
Changing Datagrid elements programmically in C#You really identified the problem. Once I set the aDataSet table name to "Employee", everything suddenly works. I spent days working on this problem and got so frustrated. I am so thankful for your tip. Such a little detail can make such a difference. Thanks again for your help. Vern
-
Changing Datagrid elements programmically in C#I am using the Datagrid form control in C#.net environment. I have no problem binding the datagrid to the datasource and displaying the table I want to display. But I am having a problem changing some of the grid elements using code after I have displayed the control. For example, there are some columns that need the width changed. I have not been able to change any of the grid elements/properties at all. Here is the code that displays the grid and its data: ------------------------------------------------------------------------------ DataSet aDataSet = new DataSet(); OleDbDataAdapter aAdaptor; aSqlQuery = "SELECT * From Employee"; aConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID='Admin';Data Source=CSharpDataGrid.mdb;"; aConnection = new OleDbConnection(aConnectionString); aAdaptor = new OleDbDataAdapter(aSqlQuery, aConnection); aAdaptor.Fill(aDataSet); this.dgEmployee.DataSource = aDataSet.Tables[0]; -------------------------------------------------------------------------- As I said, this code brings up the control with the data loaded. Now I am trying to change the width of one column: -------------------------------------------------------------------------- DataGridTableStyle EmployeeTableStyle = new DataGridTableStyle(); EmployeeTableStyle.MappingName = "Employee"; DataGridColumnStyle ColumnFullName = new DataGridTextBoxColumn(); ColumnFullName.MappingName = "Name"; ColumnFullName.HeaderText = "Full Name"; ColumnFullName.Width = 5; EmployeeTableStyle.GridColumnStyles.Add(ColumnFullName); ----------------------------------------------------------------------- This code has no effect on the displayed grid. I would expect the DataGridTableStyle to be associated with the Employee table in the grid dataset. And then I would expect the column “Name” would change as per the above code. But nothing happens. Would appreciate any tips on how to change row and column properties (width, color, selection status, etc) using C# code. Thanks, Vern Vern