How can I do format dynamic grid view in VB? - asp.net

I got issue to format the dynamic grid view in vb. Hopefully anyone can help me to give some idea for this.
Apparently as in the image, in the red box will be dynamic sub header and dynamic rows. The value for those dynamic item were define by user entry. So I will retrieve the value of the sub headers and rows from database.
However, I faced issue when it come to format it into VB. Hopefully you may help me to give some ideas about it.
I believe that I still need to <asp:GridView></asp:GridView> in markup and also format the dynamic in code behind.
Thanks in advances.

I would suggest for such additional customizing, you use a list view.
And your heading requirements look NOTHING like a heading from a database table. So, a gridview (or better listview) can render the repeating rows of data.
But that heading part? That's not a database heading of columns at all - not even close.
This suggests that the top part can't really be a heading for the listview/gridview.
However, I do suggest that listview would be much better here then a gridview. the reason is both the rows of data, and the heading part can be markup with a listview.
In the gridivew, you could even layout that top part OUTSIDE of the lv, and then consider if it worth the efforts to move that layout into the lv, or just leave it on top.
So, I would just layout the top part as standard web layout like anything else you wish to have on that page.
Then below, you could use a listview/grid view for the repeating rows of data.
You might then be able to take what you laid out separate for the top part, and drop that into the listview, but it probably not worth the trouble.
Given the layout for the top part - I leaning towards the idea of building that separate. It also not clear how normalized the data source is for this, and how many tables are involved. So, boatloads of issues and details here, that would amount to 50 more pages of questions.
However, a list view would be a better choice for such high degrees of customizing. I would thus spend some time googling list view examples for asp.net.
but, that top part is a best as a separate part, and task for you to create. (so it really a form type of layout, and not some "repeating" set of row data).
however, for the bottom repeating rows of data? Listview or grid view would suffice. But the top part is not any kind of classical database heading based on column names with simple rows of data repeating below. that's going to be just pure HTML layout, and you have to do that as such like laying out any other web page.
One might even just use a plain jane HTML table for that part.
Note how listview allows this in the heading layout:
<LayoutTemplate>
<h2>My Cooling heading area layout</h2>
<div style="width:140px;border:solid;background-color:aquamarine;float:left">
Holiday description
<asp:TextBox ID="TextBox1" runat="server" BackColor="Transparent"></asp:TextBox>
</div>
<div style="width:140px;border:solid;background-color:aquamarine;float:left">
Holiday description
<asp:TextBox ID="TextBox2" runat="server" BackColor="Transparent"></asp:TextBox>
</div>
<div style="clear:both"></div>"
<table id="itemPlaceholderContainer" runat="server" border="0" style="">
<tr runat="server" style="">
<th runat="server">FirstName</th>
<th runat="server">LastName</th>
<th runat="server">City</th>
<th runat="server">Active</th>
So, we see this:
If I run the above, we get this:
so you can layout the heading part with ANY kind of markup you want.
but then below is the table layout for the repeating rows.
so you can layout quite much any HTML markup for the repeating rows (easy), and then layout the heading part (hard), but at least using a listview allows this. So, listview has much more configuration and layout abilities then does gridiew.
For a simple grid of data? Gridview is great.
For more complex, but more work? then use listview.

Related

Semantic-ui Table: how to make a column selectable

I would like to make table column selectable with semantic-ui. Whereas it is clearly explained in the doc how to make a row selectable (https://semantic-ui.com/collections/table.html#selectable-row), I can not figure it out for a column.
Is there a way to achieve it ?
Thanks a lot in advance
<tr>
<td class="selectable">Selectable entry</td>
</tr>
This is the solution i came up with. Im sorry that this might be too late two years after.
So the thing is, that you cant make a row selecteble that easy so I made the single entries selectable. From this selection you can determine which column was clicked in.

Kentico Nested repeater for grouping similar items

Anyone with an idea on how to create a nested repeater for kentico? I am trying to achieve a picture gallery with an album such that the album is displayed and a click on an album takes you to the pictures in that album.
I wish I only see a sample as I have only been able create a single repeater creating a picture gallery and not a picture album.
here is my code:
<cms:CMSRepeater ID="pixgallery" runat="server" ClassNames="custom.Gallery"
TransformationName="custom.Gallery.Preview" >
</cms:CMSRepeater>
How do I manage this>
The nested controls are used to display some kind of hierarchy. Please see the sample. Or, you can also use Hierarchical transformations.

How to avoid blank lines corresponding to empty <tr> tags

I am displaying several asp.net panel controls using an html table. Initially the panels are set as visible = false. Depending upon the data from database, some of the panels will be made visible. The problem is if the second and tenth panels are made visible, there are several blank lines are displayed in the page since there are several empty tags created corresponding to invisble panels. please let me know how avoid the blank lines.
Thanks
give style instead of visible property
<div style="display:none"></div>
then from code behind make display : "block" this will hide your element completely and there will be no empty spaces.
If you place your <tr> tags within the Panel control, these will not be rendered out when Panel.Visible == false:
<asp:Panel ...>
<tr>...</tr>
</asp:Panel>

How to get two TreeViews to display side-by-side?

This seems quite trivial but I can't seem to find out how to place two TreeViews (or any control with a TreeView) so that they sit right next to each other.
Any attempt always results in the TreeView claiming its own line on the displayed page. In other worse, the TreeView always ends up below or above the other control that I want it to be next to.
I've also tried to do this with two panels next to each other and they would simply sit on top of one another. I am sure I am missing something basic.
How do I place any of these controls so they are displayed right next to one another?
Have u tried
<table>
<tr><td>First Tree View<td>
<td>Second Tree Vie</td>
</tr></table>

Editing an ASP.NET table control using the Design View in Visual Studio 2008

I have spent a while searching google for an answer to the following question, with no luck.
Does anyone know if there is any way (at all) to use the Design view to edit the contents of an ASP.NET table control (an <asp:Table runat="server">...)?
From all that I can tell, devs are stuck coding their <asp:TableRow>s and <asp:TableCell>s by hand! This is ludicrous, given that you can use the design view as a WYSIWYG editor for standard HTML tables.
In design view go to the properties of your table and select rows and click the button. You can add rows there. Likewise the row properties has a cells property that lets you add cells one at a time.
Still pretty bad but it would cut down on the hand typing.
There is a Rows property you can play with in the design view.
As you add rows to the Rows collection, you have access to the Cell property as well through the dialog presented to you.

Resources