|
Sorry Same Post..!
http://www.codeproject.com/KB/webforms/MenuControlSelectedItem1.aspx
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I want to use dropdown list in Web Parts
but in web parts dropdown can be use using Enum only.
I want to bind Dropdown with datatable (value comes from database at runtime)
and one more thing I have 2 dropdown lists in a web part
second dropdown bind on the basis of selected value of First one.
Please tell me how to bind dropdownlist in web parts
I need to maintain personalization
Thanks
|
|
|
|
|
What every you want to with dropdownlist do it in a user control . Place the user control inside the web parts.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
i need to maintain personalization also
means selected values in all dropdown should be maintain as per user log in.
is this possible using user control ?
|
|
|
|
|
Yes. Personalization is nothing do with User control, Its based on your web parts. First of all you need to configure your database.
Read this article,
Webparts Personalization[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I already configured database.
I can get personalization if there is any texbox. just i need to personalize the property.
but i want to do the same with dropdown.
in web parts dropdown can be show using Enum.
that propery must be of enum type if you want to show dropdwon then it automatically converts it into a dropdown.
how can i achieve this if i have a datatable or data comes from database at runtime ?
|
|
|
|
|
I want an editable Dropdown for the asp.net application. This ASP.net 2.0.
Please can anybody provide the code?
|
|
|
|
|
|
|
I have a background image and I want a part of it to be transparent (instead of white). Is that any way to do it?
|
|
|
|
|
Use photoshop to do that.
|
|
|
|
|
Create Watermark image using some tool, then set it as Table background !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I m developing a online exam portal . I have used a javascript for timer. when time finishes it should fire a button_submit.
but when user hits a refresh button time is starting from first.
Is there any way to copy timeAlloted value when page is unloaded . or to use any session variable to store the value before unload and retrive after reloading the page.
** i have used question paper in iframe and timer display in parent page. when time finishes it should fire a submit_click which is hidden in question page(inside iframe).
|
|
|
|
|
Be aware that whatever you do, unless you store the time you started on the server, the user will be able to cheat it. And if you store it on the server, you can use that on postback to refresh the time remaining.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
After logging out of my web application I do not want the user to be able to get back into it simply by clicking the browser Back button.
After doing some reading I don't think javascript will allow you to clear browser cache. Do I have to prevent all my asp pages from being cached? On commercial sites it seems that caching is on because the Back button does work. However, after logging out and hitting the Back button an expired page is displayed. How do they do this?
|
|
|
|
|
|
Place this on every page for which you want the back shouldnt be enabled :
function disableBack(){window.history.forward();}
disableBack();
window.onload=disableBack;
window.onpageshow=function(evt){if(evt.persisted)disableBack();}
window.onunload=function(){void(0);}
This is tested on MSIE, FireFox, Safari and Opera.
|
|
|
|
|
Does this mean when you have a logout feature you cannot use the browser cache?
|
|
|
|
|
Hi,
I am using ultrawebgrid in my pages. I am specifying the EditorControl by setting EditorControlID in the InitializeLayout event of the grid. This works fine if I don't have paging or if I am not rebinding the grid. When I enable the paging, the EditorControl works fine in the first page. But when we move to the next page, the EditorControl get's lost. The same is the case when I rebind the grid (as I did in paging). I am giving you the sample code below. Can anyone please help me in resolving this?
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
InitializePage();
}
}
private void InitializePage()
{
PopulateReportingPeriodTasksGrid();
Infragistics.WebUI.UltraWebGrid.UltraWebGrid comboGrid = (Infragistics.WebUI.UltraWebGrid.UltraWebGrid)StatusCombo.Controls[0];
comboGrid.DisplayLayout.AllowAddNewDefault = Infragistics.WebUI.UltraWebGrid.AllowAddNew.Yes;
comboGrid.DisplayLayout.AllowUpdateDefault = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes;
}
private void PopulateReportingPeriodTasksGrid()
{
DataSet ds = new DataSet();
ds.Clear();
ds = DataService.ListReportingPeriodTask(UserIdentity, (int)TaskStatus.Status.Open);
if (ds != null)
{
ReportingPeriodTasksGrid.DataSource = ds.Tables[0].DefaultView;
ReportingPeriodTasksGrid.DataBind();
}
}
protected void ReportingPeriodTasksGrid_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
{
e.Layout.Bands[0].Columns.FromKey("TaskStatus").Header.Caption = "Status";
e.Layout.Bands[0].Columns.FromKey("TaskStatus").Type = Infragistics.WebUI.UltraWebGrid.ColumnType.Custom;
e.Layout.Bands[0].Columns.FromKey("TaskStatus").EditorControlID = "StatusCombo";
e.Layout.Bands[0].Columns.FromKey("TaskStatus").AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes;
e.Layout.Pager.AllowPaging = true;
e.Layout.Pager.PageSize = 25;
}
protected void ReportingPeriodTasksGrid_PageIndexChanged(object sender, Infragistics.WebUI.UltraWebGrid.PageEventArgs e)
{
this.ReportingPeriodTasksGrid.DisplayLayout.Pager.CurrentPageIndex = e.NewPageIndex;
PopulateReportingPeriodTasksGrid();
}
This is one scenario as I explained above...in case page index changed, I am calling the PopulateReportingPeriodTasksGrid() function again and that's when the EditorControl stops working. I've another page, where I am not using "paging", but doing the same as I am doing in the PopulateReportingPeriodTasksGrid procedure. Even in that case, the EditorControl will not work.
Thanks,
Kala
|
|
|
|
|
I think it is better to write this in Infragistics Forum as you will get more people regarding this.
I think the problem is because of not handling the Viewstate of the control properly. check yourself if you are missing something.
You may try removing the line :
PopulateReportingPeriodTasksGrid();
from ReportingPeriodTasksGrid_PageIndexChanged to see what happens then.
|
|
|
|
|
Hi Abhishek,
ThanQ!
I've posted in Infragistics forums also. I am trying to see if someone here faced this kind of problem. We need to bind the grid in PageIndexChanged event. Otherwise, paging won't work.
-Kala
|
|
|
|
|
Have you check removing the line which repopulates the data again.
Also try to do another this
In page_Load write
if (!IsPostBack)
{
InitializePage();
}
PopulateReportingPeriodTasksGrid();
}
and
protected void ReportingPeriodTasksGrid_PageIndexChanged(object sender, Infragistics.WebUI.UltraWebGrid.PageEventArgs e)
{
this.ReportingPeriodTasksGrid.DisplayLayout.Pager.CurrentPageIndex = e.NewPageIndex;
}
I think this might be the problem, you are setting the CurrentPageIndex before the data being bound to the control. I am curious if this is the problem with you??
|
|
|
|
|
This change didn't fix it. I see that there is a javascript error though - "'null' is null or not an object".
As said in my initial post, it's not just with paging, whenever I had to rebind the grid, this problem occurs. Looks like the fact that there is an Editor Control is getting lost ( due to viewstate issue or some other problem). I am still trying to debug the same!
Thanks,
Kala
|
|
|
|
|
Anyone? Any thoughts?
In fact, it looks like it's happening on Postback. Am I missing something in restoring the state or something like that? Can you please test the same in a sample application? I tried setting the postback properties to true for the grid but it didn't work!
Thanks,
Kala
|
|
|
|
|
Hi All,
I am trying to create Enum Dynamically.
When I try to Save dll It gives me error - "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" I am also writing code snippet :-
AppDomain currentDomain = AppDomain.CurrentDomain;
AssemblyName aName = new AssemblyName("TempAssembly");
AssemblyBuilder ab = currentDomain.DefineDynamicAssembly(aName, AssemblyBuilderAccess.RunAndSave);
ModuleBuilder mb = ab.DefineDynamicModule(aName.Name, aName.Name + ".dll");
EnumBuilder eb = mb.DefineEnum("Elevation", TypeAttributes.Public, typeof(int));
eb.DefineLiteral("Low", 0);
eb.DefineLiteral("High", 1);
Type finished = eb.CreateType();
ab.Save(aName.Name + ".dll");
I got error at last line. I am working on Vista Premium.
I gave permissions to Network Service User but still not solved.
Please help me.
your help is appreciated.
Regards,
Sdhimann
|
|
|
|