| |

VerySource

 Forgot password?
 Register
Search
View: 687|Reply: 4

Why DataGridTableStyle ccc = new DataGridTableStyle (); returns empty object

[Copy link]

2

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-15 09:30:01
| Show all posts |Read mode
dataGrid1.DataSource = temp_1; bound data source dataGrid displays normally
DataGridTableStyle ccc = new DataGridTableStyle ();
ccc = dataGrid1.TableStyles ["temp_1"]; Get TableStyles object of dataGrid1
Why can't I get the TableStyles object when the screen has displayed data?
Reply

Use magic Report

0

Threads

119

Posts

67.00

Credits

Newbie

Rank: 1

Credits
67.00

 China

Post time: 2020-4-16 16:00:01
| Show all posts
When TABLESTYLES.COUNT in DATAGRID is greater than 0, the style sheet exists. Similarly, you can also determine the value of GridColumnStyles.Count. Just set the DataSource. Although it can be displayed, it cannot refer to its TableStyle.
   Create TableStyle at design time, or execute a sentence:
   TableStyle ts = new TableStyle ();
   DataGrid1.TableStyles.add (ts);
Reply

Use magic Report

0

Threads

110

Posts

63.00

Credits

Newbie

Rank: 1

Credits
63.00

 China

Post time: 2020-4-19 17:15:02
| Show all posts
By default, the collection returned by the TableStyles property does not contain any DataGridTableStyle objects.
Reply

Use magic Report

0

Threads

17

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-4-20 18:45:01
| Show all posts
The value of the TableStyles property must be set first.
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-4-24 14:30:01
| Show all posts
Before binding, you should add a DataGridTableStyle
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list