http://bytes.com/attachments/attachment/2155d1251048605/db_preview.jpg
According to the above image.
How can i Show the table (Preview) in datagridview.
You can use nested grid views, there are number of methods to do that. Google "nested gridviews"
You can create the 2nd table, with the sport and game id only and the players cells empty, and manually insert the players in the last column, by creating another 3-row table inside each players cell.
Related
I first would like to say that I am fairly new to UWP, and my experience with Android is probably leading some some assumptions on my end. There may be a better way about this, but so far I have been trying to use the Grid class, but it doesn't seem to work in a way that I would expect.
Basic Idea
I am trying to create a UWP application with the ability of organizing elements in a matrix, where each row and column represents some category, and whatever element that is within both row and column categories is placed in that cell. One or more elements can be listed in each matrix coordinate. An image for reference is below:
To give a more clearer/specific example, let's say the Elements were Employees, rows were Teams, and columns were disciplines (Testing, Dev, Management)
Comparing different category-types can be useful for displaying information, but this will have greater importance beyond just names, so this is only a simplified example. Also, as shown in the example, the number of rows and columns is determined by the number of categories there are for each respectively (e.g. # rows = # teams and # columns = # disciplines).
I don't have any code to show, simply because this isn't so much an error problem as it is a conceptual problem.
My Questions
How would I be able to filter what elements are bound to a cell by their Row/Column? Is this even possible?
i.e. populating the cells of the matrix with elements that occupy both the corresponding row's and column's category.
How do I bind columns and rows to their respective list of categories?
e.g. whenever I add another Column Category, a new empty column will be generated.
I appreciate your help and time!
For your scenario, the better way is using DataGrid to replace.
i.e. populating the cells of the matrix with elements that occupy both the corresponding row's and column's category.
You could use binding way to specific current element in which column and row, but you need to calculate before preparing data source for Grid panel.
whenever I add another Column Category, a new empty column will be generated.
If you use DataGrid, it will generate Column base on your item's new filed. Here is code sample that your could refer.
I am using rdlc report and using table in it.I want to make following desingn in rdlc but when i drag database column in row group table properties it shows columns on left side.I want Eng Crs Name and Arabic Crs are parent group and Eng Gender and Arb Gender are child group.Where Eng is english and Arb is Arabic.Both are same columns but different language.How can i achieve this following design.
Eng CrsName EngGender Students ArabicGender ArbCrs
engname1 EngM 2 ArabicM arbn1
EngF 3 ArabicF
engname2 EngM 4 ArabicM arbn2
EngF 5 ArabicF
The most common way to have parent and children columns is by using the Matrix component. I suggest you give it try on your own first, it should be self explanatory.
If the Matrix does not meet your desires, there is another easy way to group data in an RDLC Report by using the List component.
You can add a table with just the table headers at the top, so it won't be repeated. And then drag the parent (column on which you wish to group) to a TextBox inside the Rectangle of the List. Make sure you group the List on that column.
Next you can add a Table with the children data into the rectangle. If there are multiple children, this table will generate multiple rows inside the rectangle. This rectangle will then repeat for every parent item, grouping everything nicely. You can also add lines to represent columns as you see fit.
I hope this helps you a little, if not you should describe your datasource in a bit more detail and I might be able to give a more accurate solution.
Here is a more visual representation of what i tried to explain with words:
I've had a Google but I find no answer. You know how say in MS Word, when you insert a table, you can merge the columns of one single row to create a column-less row? Or have say a main header and then more columns inside it? Like so:
Merged Row:
|Column 1|Column 2|Column 3|
|Value|Value|Value|
|Merged Row|
|Value|Value|Value|
God the text formatting is awful on this web-site...and the Header Column example:
|Main Header||Another Main Header|
|Column 1|Column2||Column1|Column2|
I'm trying to achieve this in a written DataTable in C# which is being populated by an array. But I'm interested in changing its structure as one of the above, whichever is possible/easier.
So I've created my DataTable and added normal columns and rows etc. But I'd like to create either a merged row or a main header to display. Instead of having a repeated value in a single column for the values I am getting.
Can someone please provide a quick example on how I could achieve either one of those? Because repeated value will just look ugly.
Cheers.
You're talking about displaying data in a particular way but a
DataTable has nothing to do with display. It is for storage and that's
that. How you display the data is up to you. The same data can be
displayed in innumerable different ways. In a WinForms app, one of the
most common ways to display the contents of a DataTable is with a
DataGridView. You can choose which columns to display and merge cells
in that grid if desired. In short, you're looking in the wrong place
to do what you want to do. It is a presentation issue, not a data
issue. –
jmcilhinney
I am very new to syncfusion and I am kind of stuck with this problem. I can easily populate a table if all of the rows and cells are created but I run into 'IndexOutofBounds' error once my data exceeds the number of rows in my template table. How can I add a row to a growing template table using Syncfusion in C#? I also would like to know how to handle the possiblity of the table growing to more than one page.
Adding a row is an easy task. After adding the row the cell paragraphs have to be added and formatted. That was the error I was running into.
IWTable table = new IWTable();
table.AddRow(True);
table.Rows[0].Cells[0].AddParagraph().AddText("sample text");
If you know the exact number of rows and columns, then you can utilize the below code to define rows and columns for a table.
IWTable table = document.LastSection.AddTable();
table.ResetCells(10, 4);
If you are not sure about the number of rows then you can use the below code to add a row dynamically.
table.AddRow();
Is it possible to display master-child rows in Excel using C#?
For example, the first row has two children, so there will be a plus sign. When the user clicks it, the children are displayed.
Yes, you can do this with Pivot Tables. http://office.microsoft.com/en-us/excel-help/expand-collapse-or-show-details-in-a-pivottable-or-pivotchart-report-HP010175905.aspx