Search Results

Search found 2806 results on 113 pages for 'winforms'.

Page 75/113 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • How do I obtain selected rows in a DataGridView from different pages

    - by cmrhema
    Hi, I have a windows forms DataGridView, where I have data and a checkbox for each row. I will select check box for a particular row and all the selected rows will be populated in another page. if (grdEmp.Rows.Count > 0) { var selectedEmpIDs= from DataGridViewRow coll in grdEmp.Rows where Convert.ToBoolean(coll.Cells["Select"].Value) == true select coll; if (selectedEmpIDs.Count() > 0) { foreach (DataGridViewRow row in selectedEmpIDs) { selectedEmp+= row.Cells["EmpId"].Value + ","; } } } This works good only for one page. When I navigate to another page, and click the selected rows, the previous one goes off. How do I resolve it. Thanks cmrhema Note :Sorry for the confusion, When I meant it works good for a page, I meant paging. I think I need to add more inputs, There are 10 pages in the gridview. I select the first record from each page of the gridview, one after another by clicking next page( Page next button). But only the record that was selected the last is getting displayed and others and ignored off. What could be the prblm

    Read the article

  • Linq to Entities strange deploying behavior.

    - by SO give me back my rep
    Hi I started building apps with this technology and I am facing a weird problem... on some machines I need to add theese lines to the app.config to get to work: <system.data> <DbProviderFactories> <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.3.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </DbProviderFactories> </system.data> while in other machines it runs well without theese lines.... the thing is that when I add theese lines the app wont run on machines that did not needed theese lines in the firs place, and I would like not to publish to versions of the app, is there a way to solve this?

    Read the article

  • How to avoid raising an event to a closed form?

    - by Steve Dignan
    I'm having trouble handling the scenario whereby an event is being raised to a closed form and was hoping to get some help. Scenario (see below code for reference): Form1 opens Form2 Form1 subscribes to an event on Form2 (let's call the event FormAction) Form1 is closed and Form2 remains open Form2 raises the FormAction event In Form1.form2_FormAction, why does this return a reference to Form1 but button1.Parent returns null? Shouldn't they both return the same reference? If we were to omit step 3, both this and button1.Parent return the same reference. Here's the code I'm using... Form1: public partial class Form1 : Form { public Form1 () { InitializeComponent(); } private void button1_Click ( object sender , EventArgs e ) { // Create instance of Form2 and subscribe to the FormAction event var form2 = new Form2(); form2.FormAction += form2_FormAction; form2.Show(); } private void form2_FormAction ( object o ) { // Always returns reference to Form1 var form = this; // If Form1 is open, button1.Parent is equal to form/this // If Form1 is closed, button1.Parent is null var parent = button1.Parent; } } Form2: public partial class Form2 : Form { public Form2 () { InitializeComponent(); } public delegate void FormActionHandler ( object o ); public event FormActionHandler FormAction = delegate { }; private void button1_Click ( object sender , EventArgs e ) { FormAction( "Button clicked." ); } } Ideally, I would like to avoid raising events to closed/disposed forms (which I'm not sure is possible) or find a clean way of handling this in the caller (in this case, Form1). Any help is appreciated.

    Read the article

  • How to loop through the ChartColorPalette properties and add to list?

    - by John M
    I am using the Microsoft Chart Controls for .NET 3.5 (C#) and have a chart in a winform. My hope is to allow the user to change the color palette based on their preference. How do I iterate through the color properties of the ChartColorPalette and add them to a combobox list? I know it should be something like: for each(something in ChartColorPalette) { combobox.items.add(something.ToString); }

    Read the article

  • List Form controls in a Combobox

    - by serhio
    how should I list a form controls in a Combobox of the same form(like VS designer does)? I tried: cboObjectSelection.DataSource = Me.Controls but this does not work. Is there a possibility to filter(customize) this list?

    Read the article

  • How to make c# don't call destructor of a instance

    - by Bình Nguyên
    I have two forms and form1 needs to get data from form2, i use a parameter in form2 constructor to gets form1's instance like this: public form2(Form form1) { this.f = form1; } and in form1: Form form2 = new Form(this); But it seem form1 destruct was called when i closed form1. my question is how can i avoid this problem? EDIT: I have many typing mistakes in my question, i'm so sorry, fixed: I have two forms and form2 needs to get data from form1, i use a parameter in form1 constructor to gets form1's instance like this: private Form f; public form2(Form form1) { this.f = form1; } and in form1: Form form2 = new Form(this); But it seem form1 destruct was called when i closed form2. my question is how can i avoid this problem?

    Read the article

  • Propagate properties to parent control C#

    - by Martin Ch
    Is there any way how to propagate properties from child control into parent - so I can access property like - Parent.Property1 instead of Parent.Child.Property1 ? I cant use inheritance - my parent cant be extended child type - its inherited from different class. Also I dont wanna add code for each property from child to parent like: public object Property1 { get{ return Child.Property1; } set{ ChildProperty1 = value; } } Maybe using reflection - something like this? public PropertyInfo[] Properties { get{ return Child.GetType().GetProperties(); } set{ Child.GetType().GetProperties().SetValue() = value.GetValue()} } Thanks

    Read the article

  • Wrap a list to add an empty row for UI binding.

    - by TheSean
    I am binding a List to a UI Control. My list does not contain a blank row, but I need to add one to allow the user to select blank. However, I'm using the same list in other parts of the application (users can edit/add/delete items) where it doesn't make sense to show a blank row. My idea is to create a wrapper around the list which adds a blank row just for the UI. The wrapper would hold a reference so that updates to the list (from other parts of the app) would be reflected in UI without any extra work. I have tried a few different ways, but nothing has worked out for me yet. Can anyone solve this problem?

    Read the article

  • help with Error during run my C# program

    - by Gold
    hi i got this error: CLR Error: 80004005 when i try to run my C# program on Windows XP. when i try to install FrameWork 2.0 - i got this error: there is a problem with this windows installer packege. what can be the problem ? thank's in advance

    Read the article

  • C# ToolTip will not re-appear after first use.

    - by Roberto Sebestyen
    I have a Forms C# application where I would like to use a toolTip on one of the text boxes. I Initialize the tool-tip in the constructor of the Form class, and it works the first time. So when I hover over the text box with my mouse it works, but once the toolTip times out and it goes away, it does not re-appear when I move my mouse away and back onto the control. I would expect it to come back and I'm wondering what I'm doing wrong. Here is how I initialize the tooltip: myTip = new ToolTip(); myTip.ToolTipIcon = ToolTipIcon.Info; myTip.IsBalloon = true; myTip.ShowAlways = true; myTip.SetToolTip(txtMyTextBox,"My Tooltip Text");

    Read the article

  • C# : Problem in creating diffrent types of columns in a gridview

    - by Royson
    My windows form application has a grid view control with filename as a default column. User should create a column of following types Text, Number, Currency, Combo Box, Check Box, Radio Button ,Date time type (should display DateTimePicker control) and Hyper Link type. After that i want to pass all rows to next screen for further processing. We can create a column of these types in a grid view but how can i store it in a data table so that i can pass it to next screen. Or should i create a column in a data table and then assign data table to grid view by gridview.DataSource = dt; but can we create a these types of columns in a data table. I am so confused!! Please help me to solve this problem. Thanks

    Read the article

  • Set MdiParent to null (Nothing) in FormClosed

    - by serhio
    In my project I observed that in a FormClosed method (that handles FormClosed event) is set MdiParent = Nothing (null). This code makes (? no idea why) that OnLoad(method) on some child panels is raised. Is there any sense to set MdiParent to null (Nothing) in FormClosed?

    Read the article

  • C# cross thread dialogue co-operation

    - by John Attridge
    K I am looking at a primarily single thread windows forms application in 3.0. Recently my boss had a progress dialogue added on a separate thread so the user would see some activity when the main thread went away and did some heavy duty work and locked out the GUI. The above works fine unless the user switches applications or minimizes as the progress form sits top most and will not disappear with the main application. This is not so bad if there are lots of little operations as the event structure of the main form catches up with its events when it gets time so minimized and active flags can be checked and thus the dialog thread can hide or show itself accordingly. But if a long running sql operation kicks off then no events fire. I have tried intercepting the WndProc command but this also appears queued when a long running sql operation is executing. I have also tried picking up the processes, finding the current app and checking various memory values isiconic and the like inside the progress thread but until the sql operation finishes none of these get updated. Removing the topmost causes the dialog to disappear when another app activates but if the main app is then brought back it does not appear again. So I need a way to find out if the other thread is minimized or no longer active that does not involve querying the actual thread as that locks until the sql operation finishes. Now I know that this is not the best way to write this and it would be better to have all the heavy processing on separate threads leaving the GUI free but as this is a huge ancient legacy app the time to re-write in that fashion will not be provided so I have to work with what I have got. Any help is appreciated

    Read the article

  • Insert a default row into a combobox that is bound to a datatable?

    - by John M
    On a winform there is a combobox that derives its information from a datatable. The datatable draws from a database list. this.cboList.DataSource = pullData(); this.cboList.DisplayMember = "fieldA"; Once the DataSource is set I am not able to insert a default row (ie *) as the first item in the combobox. I tried this: this.cboList.Items.Insert(0,"*"); Is there a way to insert in the combobox after the datasource is set or should this be done in the datatable?

    Read the article

  • ALT-TAB Application Icon Pixelated

    - by Red Potato
    When a child window of my application is opened and I view the ALT-TAB menu, the application icon looks pixellated. I assume that Windows uses a low resolution version of the icon (16x16 pixel I think). What can I do that Windows selects the right version which would be 32x32 pixel? I assigned an icon to the window in question that has 16x16, 24x24, 32x32, 48x38 and 256x256 in true color. Please note that VS says in the proterties that 32x32 is used and that it works fine for the main window of my application where I assigned the exact same icon.

    Read the article

  • Prevent ListBox scrolling to top when updated

    - by WDZ
    I'm trying to build a simple music player with a ListBox playlist. When adding audio files to the playlist, it first fills the ListBox with the filenames and then (on a separate thread) extracts the ID3 data and overwrites the filenames with the correct Artist - Title information (much like Winamp). But while the ListBox is being updated, it's unscrollable, as it always jumps to the top on every item overwrite. Any way to prevent this?

    Read the article

  • this.Width=30; NOT WORKING!

    - by j-t-s
    Hi All, I've been doing this for years. But now it's just not working. private void Form1_Deactivate(object sender, EventArgs e) { this.Size = new Size(30, 29); txt.Visible = false; lbl.Visible = false; } The form just does not change Width. But, as above, the 3 controls DO become invisible. Any suggestions?

    Read the article

  • 2 Controls, 1 event

    - by DTown
    I have 2 input textboxes that take a host or IP. When the user leaves an input box an event is fired that checks the input to see if it is actually a live computer. The results are then put into the appropriate label. My question is, should I be using separate events for each input box, since they update different labels? Or, can I use 1 event and check who the caller was, then update the appropriate label?

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >