Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

Peter8675309

@Peter8675309
About
Posts
7
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Multiple Conditionals
    P Peter8675309

    Thanks for the function. It works great.

    Database database data-structures oop question

  • Setting Colum widths in a datagrid
    P Peter8675309

    Where is datatablestyles defined? I don't see it in the help of on MS's site. How is this class defined? If it comes from WebControls, I am working on a windows form. Thanks for your help.

    C# css

  • Setting Colum widths in a datagrid
    P Peter8675309

    Yes this is a windows form. If I add in dgResults.TableStyles[0].GridColumnStyles.Clear(); I get an 'index out of range' error unless I prepopulate the TableStyles of the grid prior. I took a look at the code at section 5.3.2 from http://www.codeproject.com/csharp/PracticalGuideDataGrids4.asp#\_Toc56951053. This functions (if I set the dt equal to me dataset.Column), but it still doesn't modify the column widths. X| Thanks for your quick reply.

    C# css

  • Setting Colum widths in a datagrid
    P Peter8675309

    I am programatically building a dataset that populates a datagrid. I need to then specfify the column widths for each column. However, the grid control ignores my input. I first tried setting the widths under TableStyles/GridColumnStyles. That was ignored so I figured it was because I wasn't populating the grid from a predefined datasource. So then I tried progammatically. Still nothing. Below is my code. The grid should only have one table in it. The grid populates correctly, it just doesn't format the widths of the columns. The dataset only returns 3 columns.:confused: //get the data dsResults = SqlHelper.ExecuteDataset(Conn,CommandType.StoredProcedure,"usp_GetSearchResultsSel",new SqlParameter("@Description", txtDescription.Text),new SqlParameter("@SearchParameters", cboSearchParam.SelectedText)); //populate the grid dgResults.DataSource = dsResults.Tables[0].DefaultView; //settings for grid dgResults.TableStyles[0].GridColumnStyles[0].Width=200; dgResults.TableStyles[0].GridColumnStyles[1].Width=50; dgResults.TableStyles[0].GridColumnStyles[2].Width=100; dgResults.ReadOnly=true;

    C# css

  • Multiple Conditionals
    P Peter8675309

    I am writing a stored procedure where the WHERE clause may contain 100's of conditionals (i.e. UserID=1 OR UserID=2, etc). The field being searched will always be the same. It is just the number records to be returned I won't about. Is there anyways to pass the stored procedure an array or something similar to specify the records to return? Writing a statement that includes 100's of "UserID=1 OR UserID=2 OR..." breaks my layer abstraction so I'd rather just send the list of User ID's I want to get. Is there any way to do something like this?:wtf:

    Database database data-structures oop question

  • Multi-Column What
    P Peter8675309

    Nick; Turns out the datagrid WILL work fine. not sure what I was thinking (maybe I wasn't). The only thing I have to do now is programatically set the column widths for the data. :)Thanks for the quick reply.

    C# database question

  • Multi-Column What
    P Peter8675309

    I have a dataset that contains multiple columns of text that needs to be displayed in a control on a Windows form - much like a spreadsheet. The rows need to be selectable so I can retrieve data later on in the application (by being able to retrieve an index or column ID). I'd like the entire row to be selectable rather than just a specific column. I have looked at using a datagrid, but that seems to be overkill. I also looked at some multi-column listbox controls on Code Project but they go much farther than I need my control. Perhaps there is another control or custom control I should use?:confused:

    C# database question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups