|
Do you mean that Datagird retains the Data during post-back which you don't want?
Regards - J O H N -
|
|
|
|
|
yes frnd
thnx for advance
|
|
|
|
|
If the Viewstate is enabled then the DataGrid will persist the Data during postback. if you want to clear the DataGrid then set the Datasource property to Nothing and do a DataBind.
DataGrid.DataSource = Nothing<br />
DataGrid.DataBind()
Regards - J O H N -
|
|
|
|
|
frnd
i wrote this code in form load
DataGrid1.DataSource = Nothing
DataGrid1.DataBind()
but not working.if i refresh the form the old data also added with new data.
plz give some other solution
|
|
|
|
|
I guess this is the only way to clear the DataGird. How is it possible to display the Old Data when you set the DataSource property to Nothing ?. I guess there is something terribly wrong with your system. How about this alternative...
DataGrid1.Visible = False
If this alternate is also not suitable for you requirement then just put a breakpoint in each event and function in your page and do a step-wise execution and try to trace and fix the problem.
Regards - J O H N -
|
|
|
|
|
hi frnd
DataGrid1.Visible = False
or
datagrid1.datasource = nothing
datagrid1.databind ()
these coding is working i not deny that, but if u refresh the form the old data also coming, ur coding is tempraverly hide the data not deleting the data, plz give some other solution.
|
|
|
|
|
I really couldn't get what exactly the problem is....
ps.srinivasan wrote: the old data also coming
What do you mean by this? There is nothing called old data or new data in DataGrid. Whatever Data that you Bind to the DataGrid will be shown. Did you try to trace the Code?
ps.srinivasan wrote: ur coding is tempraverly hide the data not deleting the data
Are you talking about page caching?
Regards - J O H N -
|
|
|
|
|
many many thnx frnd
ur code is working
"datagrid1.datasource=nothing
datagrid1.databind()"
this code is working perfectly,i declared DATASET variable in global, so that time is not worked,that is mine mistake,thnx for replay,
|
|
|
|
|
Just refresh ur grid as the condition u like. u will immediately get ur desire result.
Devjit Das
|
|
|
|
|
sorry frnd i dont know how to refresh data grid in asp.net plz give idea.
|
|
|
|
|
Just use the condition which u bind with grid or use to delete grid row. which one u like or easy for u.
Devjit Das.
|
|
|
|
|
creating permission to a particular role manager to access a page .the roles will be created by user and how he set to access a .aspx page using c#.that means in webcofig file we can set rol;es to acces a particular page to a role manager.if an afministrator creates a user and set permision to access a page.how is it possible
|
|
|
|
|
i am not able to see the user id. When i debugged it Page.User.Identity.Name was returning null string.
What is actually the problem. What should i do to get rid of it.
Pandi
|
|
|
|
|
What is the authentication mode here?
Regards - J O H N -
|
|
|
|
|
hi iam using two dropdown lists in my application.one dropdownlist filled with database in pageload.the second dropdown list can fill by select index change of the first dropdownlist using ajax.here the values are displayed .but after selection of the value it will be disappear.how can i show selected value in dropdownlist in asp.net
plz help asap.
regards
venkat
|
|
|
|
|
Are you just usng AJAX, or relying on the Microsoft AJAX library ? When does the value disappear ? Odds are high that when you do a postback, the values, which were not in viewstate, will be lost. You should populate the second list based on the selected index of the first list during a postback.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi friends
i have one a.aspx and one usercontrol.
I have defined one public property in code behind file in user control.
I have one link button in form and I load dynamically usercontrol in the page on click of this button.
My code is here
PlaceHolder.Contrls.Add(LoadControl("usercontrol.ascx"));
But I want to access property.
How can I do this?
Thanks in advance.
best regard
pathan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Iterate over the controls in PlaceHolder, and find the one that is an instance of the user control. If you want to access it right away, do this:
userControl control = LoadControl("usercontrol.ascx");
control.property = value;
PlaceHolder.Controls.Add(control);
This code is obviously not copied from your code, it has a typo, it's best to paste the code so we see exactly what you're running.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i have done it by following code
UserControl uc = ((UserControl)LoadControl("UserControls/ucEditLetter.ascx"));
Type ucType = uc.GetType();
System.Reflection.PropertyInfo ucPropInfo = ucType.GetProperty("LetterID");
ucPropInfo.SetValue(uc, "value", null);
divLoadFCK.Controls.Add(uc);
Thanks
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi all,
In my form i have a textbox field wherein the user needs to input his email address. All i need to do is make this field mandatory as well as i need to check it for correct format. For this purpose i have used a required field validator and a regular expression validator validating the same control.
These validation fires well when the textbox lose focus but fails when i submit the form. I also checked my submit button for property causesvalidation=true .
Any help would be highly apppreciated..
|
|
|
|
|
Set VaidationGroup property to all validator ctntrols and submit button
beSt rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|
|
|
hi,
I want do display a small paragraph in a datagrid, how to fix the datagrid width in asp 2.0.
jai
|
|
|
|
|
DataGrid has an one property called Width.
You can set it by pixel.
for example.
Width="100px"
please don't forget to vote on the post that helped you.
|
|
|
|
|
hi,
In datagrid how to fix the width of a particular column.
jai
|
|
|
|