webusercontrol problem - asp.net

I have one webusercontrol for Datepicker. When I am using this control in content pages it works fine. I have many controls in content page (textbox, label, etc.). All controls are inside a table. I have placed usercontrol inside <td>. When I click on an image, the calendar control is showing. But that time this calender control pushes all other controls (textbox, label, etc.). I have set the z-index at a higher value, but still it's not working.
alt text http://www.shareimages.com/images/thumbs/0/0/1/39586-qJyWopyZlqGlk6CVmw-datepicker.jpg

Z-index will not work for you becuase it is made for absolute,fixed and relative positioned elements.
in your case what happened is when the calendar was not loaded the cell was empty but when you opened the calenday it filled the cell and expanded the row which it expanded the table. which causes the elements who are inside the tabe to change their position.
try not to put the calendar over the other rows. create new column. set rowspan and put the calendar inside that cell which it will expand in its cell with out affecting the other rows since it is in different column (this will change the desiegn but it is the easy way)

Related

How to make invisible ASP.NET controls within a certain div tag?

I have a dropdown "ddl_group" list followed by two tags containing controls related to item chosen in the first. One item in ddl_group is teacher and another item is student. By default, I have set all controls within the two div tags to invisible. They only show up when a group related to them is chosen in ddl_group.
Imagine I choose student in ddl_group. Next, controls within div.stdInfo start to appear one after the other in response to user who makes choices on controls within div.stdInfo. Now the user might want to choose another group i.e. teacher from ddl_group. Therefore, I'll need to make invisible again all controls within div.stdInfo and make visible controls within div.teacherInfo.
Is it possible to make invisible or visible all asp.net controls within a certain tag (e.g. div tag) in one place rather than setting them individually?
You can place your div in
ASP.NET Panel Control
then you can make it
pnlName.Visible=true; or pnlName.Visible=false;
when ever you want or
you can use Div with
runat="server"
attribute so that it is accessible in code page
their you can do it like
divname.Visible=true; divname.Visible=false;
You can use ASP.NET Place holder or ASP.NET Panel controls for these purposes.
Wrap your content with Place holder or Panel.
On SelectedIndexChanged event of your drop down, you can change visibility of this PlaceHolder or Panel.
If you add a runat tag and an ID tag to your divs, that will make them accessible via server side code. I prefer this way because I don't have to mess-up my css at all.
e.g.
markup:
<div class='teacherinfo' ID='teacherDiv' runat='server'>
.
.
.
.
.
</div>
code behind:
teacherDiv.Visible = false;
One word of warning, making a server-side control invisible means that it will not be present on the resulting html document. So if you try to find it with javascript document.getElementById("<%= teacherDiv.ClientId %>"), you'll get an error.

Looking for a vb.net code to add existing buttons/text boxes/drop down lists, etc. to a container, or holder?

I'm using vb.net. Basically, I have a drop down list, text box and a submit button. You choose a movie director from a drop down list, then type in a movie, click button and it adds the data to my database.
There's another button which hides/shows drop down list, text box and submit button using Visible = True and Visible = False, but what I don't like about it is when it hides the things I said before, it leaves some white/empty space like if they are still there, but not visible.
Is there anyway to put some kind of holder/container and place a button which when clicked could add my drop down list, text box and submit buttons to that place?
Cheers,
E.N.
I assume that you are working with WinForms in Visual Studio. In the Toolbox the controls which could help you out of this situation are in the "Containers" section. Among others, there is a Panel, a FlowLayoutPanel and a TableLayoutPanel (see this video on msdn for a TableLayoutPanel Demo). They can help you to organize controls. Especially the FlowLayoutPanel places the controls automatically. But you can always change the Top and the Left properties of any control, to move them around to the desired place or group some of them on a Panel and change the Location of this one one.
You can add a control to a container by using the Add method of its Controls property. However, if the control is already on the form (since you are asking how to add an existing control) you must remove it from the form before.
Me.Controls.Remove(myButton)
panel1.Controls.Add(myButton)

Show the child nodes in Infragistics GridView

I have implemented a hirearcial ultrawebgrid. It works as expected.
It will work like, There is a "+" icon in top row and when user clicks on the "+" it will show the child rows. All these things are working fine.
When the grid is rendered it hiding th child nodes, it will opens only when the user clicks on "+". I want the grid to show all the childnodes by default. How can i obtain that one.
To expand programmatically all nodes in a UltraWebGrid you could use this line
Me.UltraWebGrid1.ExpandAll()

ASP.NET VB Nested Listviews appearing side by side

I currently have a parent Listview and its child Listview displaying in the centre column of an HTML page that consists of three columns left, centre and right. And all looks very good.
However I would like to display the child list view in the right column beside the parent list view.
To do this it seems I must somehow generate from the code behind page a new row in the table every time the parent Listview displays a record of its data and then some column HTML so the first child list view will appear in the right hand column.
If anyone can guide if this is the best approach and how to do it, it would be much appreciated.
I'm rather surprised that you haven't gotten a response to this question in the month and some change that it's been since you posted it.
My suggestion would be to use an updatepanel (Ajax) and do just what you thought you should: When an item is selected in the parent listview, dynamically load the second listview.
Just a suggestion.

How can I add rows of data with dynamic images in Flex?

I want to add specific images to a datagrid row, depending on the data displayed on that row. These images need to be functional buttons with click handlers and everything.
For example, if a row displays status of a certain element, like "Editable" then the image displayed in the cell next to it needs to be a green flag, if it isn't Editable then I red flag should appear.
If you just need images and click handlers, there is an option to embed icons inside a datagrid.
Also, for a datagrid ,clicking on any row triggers the click event,the handler to which will give you datagrid.selectedIndex as the index of the row you clicked, which you can then use to get the data in that specific row and according to the data do a specific action you need.
To render icons in datagrid, you might want to check for labelFunction attribute, which allows you to specify a function , each time data in a datagrid row is filled, which yuo can use to determine the icon you would need the datagrid to render and show to the user.

Resources