Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid
Message
General information
Forum:
ASP.NET
Category:
Forms
Title:
Re: Grid
Miscellaneous
Thread ID:
00726739
Message ID:
00727587
Views:
15
You check the DataColumns in the DataTable, not the DataGrid and they would be checked at runtime. Look at them in the debugger or output the results of the DataColumns' property settings.

>Hi Cathi,
>
>Where do I check for the datacolumns properties of the grid? The lines of code (fillschema) that we talked about are set at runtime, I think.
>
>Where do you set the properties for tristate to no? Grid or for each field and where do I set them?
>
>Thanks
>Roland
>
>===========================================================================
>>Roland,
>>
>>I recommend checking the DataColumns for the fields in question to see what the different properties like ReadOnly, AllowDBNull, and MaxLength are showing.
>>
>>The ThreeState property of the checkbox control allows you to set how you want checkboxes to be displayed. If you don't want the third state (indetermanent) then set this property to false.
>>
>>>Hi Cathi,
>>>
>>>These are generated Connection, Adapters and the dataset.
>>>
>>>I tried the following:
>>>
>>>Me.Personnel01_Ds1.Clear()
>>>Me.SqlDataAdapter1.FillSchema(Personnel01_Ds1, SchemaType.Source, "Personnel")
>>>Me.SqlDataAdapter1.Fill(Personnel01_Ds1, "Personnel")
>>>Me.SqlDataAdapter2.Fill(Personnel01_Ds1, "JobType")
>>>Me.SqlDataAdapter3.Fill(Personnel01_Ds1, "JobTitle")
>>>Me.SqlDataAdapter4.Fill(Personnel01_Ds1, "Department")
>>>
>>>I still get values in fields that are 0 length varchar fields and allowNull not checked in SQL.
>>>
>>>The grid also shows tristate checkboxes. How do you get the grid to only show checked instead of tristate checkbox?
>>>
>>>In SQL Enterprise manager the field shows nothing and the bit (boolean) field show 0 or 1 and if null is checked in certain fields it show .
>>>
>>>Thanks
>>>Roland
>>>
>>>==========================================================================
>>>
>>>>Hi Roland,
>>>>
>>>>When you fetch data from SQL Server, ADO.NET does not default to fetching information about Primary Key, ReadOnly, AllowDBNull, MaxLength, and AutoIncrement. You can use the FillSchema to retrieve that information.
>>>>
>>>>
>>>>da.FillSchema(MyDataSet, SchemaType.Source, "MyTable")
>>>>da.Fill(MyDataSet, "MyTable")
>>>>
>>>>
>>>>
>>>>>Hi
>>>>>
>>>>>Windows Form and vb.net (Framework Properties)
>>>>>
>>>>>How do you control the grid so that it uses the allow null, default values and field types and sizes from the Sql Database Table?
>>>>>
>>>>>When I add a record to the grid it seems to ignore the information from the Sql Database Table. Puts in almost in every field.
>>>>>
>>>>>On smaller sized fields with length of less than 7 is seems not to put in a value and works wtih the AddNew record without an error message of Column 'MlsOfficeId' does not allow nulls. Do you want to correct the value?
>>>>>
>>>>>The grid put the value into the field in the first place. In SQL query the field shows nothing (varchar with the length of 0) and allownulls not checked.
>>>>>
>>>>>Why is the grid putting in values where they do not belong?
>>>>>
>>>>>
>>>>>Thanks
>>>>>Roland
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform