|
hi,
i would like to know how to put the selectedvalue of dropdownlist in textbox of gridview.
I have a dropdownlist and textbox inside gridview.
when i select a list in dropdown, the selectedvalue will put in textbox.
note: dropdownlist is a multiple column. i will put only the 2nd column on textbox.
how will i do that?
thanks in advance
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
You will need to handle the datagrid event and set the properties appropriately. Maybe this will give you a start, DataGridDemo[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
thanks for your reply. but i don't need an edititemtemplate. becuase i will save my data on gridview by bulk meaning the gridviewcolumns is in textbox not label. the user will edit directly in gridview without clicking edit button.
it will update/save data in just one click. that is why the link you given is not what i need. my question is how will i put the dropdownselected value in textbox in gridview.
example.
Gridview
----------------
column1 | column2
dropdown | textbox
-------------------
when select dropdownlist, the selected value copy in textbox.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
You can either do it by using javascript onchange event of dropdown or by using server side selected index changed event.
|
|
|
|
|
It doesn't need to be in edit mode, and you can use JavaScript
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
C# Code
this.Dispatcher.BeginInvoke(delegate()
{
PropertyChanged(this, new PropertyChangedEventArgs("FileLength"));
});
VB.NET Code
Me.Dispatcher.BeginInvoke(Function() Do
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("FileLength"))
End Function)
But it is not working i tried the code convert for the same, then did google also but unable to get the correct syntax.
Plz help
|
|
|
|
|
|
So what is the way to do the same. the senerio is
i have a delegate defind say "ProgressChangedEvent"
i my class i have a event "UploadProgressChanged" of type "ProgressChangedEvent"
now RaiseEvent ProgressChangedEvent(me,args) working fine for me, but i want the asyncronous call, so want to use.
dispature.beginInvoke( <event call="">)
so how could i call the event.
Thanks Plz help...
|
|
|
|
|
Drop the "Do" - this is a bug in the converter you used.
You can drop the 'End Function' since it's just a single statement.
Which version of VB are you using?
If you're using VB10 (VS 2010), change the 'Function' to 'Sub' since nothing is being returned.
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
Hi David,
Thanks for the reply is am using VS2008 SP1.
My Code is like below
Me.Dispatcher.BeginInvoke(Function() Do
RaiseEvent PropertyChanged(Me,New PropertyChangedEventArgs("UploadPercent"))
End Function)
As per your instructions i have change it to
Me.Dispatcher.BeginInvoke(Sub
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("UploadPercent"))
)
But it is again not working for me....
Possible solution???
Thanks
|
|
|
|
|
For 2008, you'll need:
Me.Dispatcher.BeginInvoke(Function() AnonymousMethod1())
Private Function AnonymousMethod1() As Object
PropertyChanged(Me, New PropertyChangedEventArgs("FileLength"))
Return Nothing
End Function
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
Dear All,
This is a c# code working fine in, Where files is a genric collection.
<br />
files.Count(f => f.Status == FileUploadStatus.Uploading || f.Status == FileUploadStatus.Resizing)<br />
i convert the same in vb.net using some convertion tools, and i got
<br />
files.Count(Function(f) f.Status = FileUploadStatus.Uploading OrElse f.Status = FileUploadStatus.Resizing)<br />
and its not working, got the error like
ReadOnly Property Count() As Integer' has no parameters and its return type cannot be indexed.
So plz help and let me know what is wrong i m doing here with possible solution.
Thanks
|
|
|
|
|
|
Hi every1,
I know the approaches for validating data. I went through some articles regarding validating. I face with a problem when I implementing them.
if I use the following code there is no problem.easily I can raise the error.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.ComponentModel.DataAnnotations;
namespace MvcApplication1.Models
{
public class GuestResponse
{
public string _email;
[Required(ErrorMessage = "Please enter your email address")]
[RegularExpression(".+\\@.+\\..+",
ErrorMessage = "Please enter a valid email address")]
public string Email
{
set { _email = value; }
get { return _email; }
}
public GuestResponse()
{
}
public GuestResponse(string email)
{
this._email = email;
}
}
}
I am using another approach which is attribute and methods. when I defined a class through an exception I validate my data.but the problem is I cant show them on the screen. when the exception raise it goes to the line of exception while I wanna show the message on the screen.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.ComponentModel.DataAnnotations;
namespace MvcApplication1.Models
{
public class GuestResponse
{
public string _name;
public string Name
{
set
{
if (value == null)
{
throw new ArgumentException(string.Format("Enter a value."));
} else
_name = value;
}
get { return _name; }
}
public GuestResponse()
{
}
public GuestResponse(string name, string email, string phone, Boolean attend)
{
this._name = name;
}
}
}
Could you please help me out how to fix this problem?
thanx in advance.
|
|
|
|
|
1. Remove your previous question before someone replies to it. Looks like by-miskate you posted that.
2. You need to catch the exception and then show it a messagebox or a label (on screen.)
|
|
|
|
|
|
Hello,
I have a flash menu that includes category links to my aspx pages(and sub-categories). This flash menu is located on a MasterPage, and all of my content is inside a content place holder.
Whenever i click an item in the flash menu, the flash reloads itself while entering the page, which is absolutely normal.
I tried using Frameset in .Net it didnt work for me. tried also the UpdatePanel also didnt work, maybe I've done something wrong in there or whatsoever.
Can anybody tell me please how to do this so the flash menu wont reload each time i click an item?
Thanks.
|
|
|
|
|
How are you using the iframe and UpdatePanel? Anything that causes a postback will of course cause the page to reload and hence the Flash.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
i used the UpdatePanel by draging it to the masterpage and inside of it i draged my flash control, and pointed a trigger to the contentplaceholder. but that didnt work for me
about the Iframe.. im not sure if i did it the right way.
|
|
|
|
|
Farraj wrote: im not sure if i did it the right way
Neither am I, my mind reading ability is only good within 3 meters of someone.
Perhaps if you showed some code we could help.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
update panel:
masterpage cs code
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ScriptManager1.RegisterAsyncPostBackControl(ContentPlaceHolder1);
}
}
aspx code:
<form id="form1" runat="server">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<uc2:menu1 ID="menu11" runat="server" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ContentPlaceHolder1" />
</Triggers>
</asp:UpdatePanel>
</form>
hmm...?
|
|
|
|
|
"Controls that are triggers for an update panel cause a refresh of the panel's content after an asynchronous postback." http://msdn.microsoft.com/en-us/library/system.web.ui.asyncpostbacktrigger.aspx[^]
So what you have configured is having the ContentPlaceHolder trigger a refresh of the UpdatePanel; however, I believe you want the reverse. Also, since ContentPlaceHolder has no events that can be triggered, nothing will happen. Finally, RegisterAsyncPostBackControl is the code behind is unnecessary since you have already specified it in the markup.
As a matter of convention ScriptManager is usually added to the top of the form.
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<uc2:menu1 ID="menu11" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="menu1" />
</Triggers>
</asp:UpdatePanel>
</form>
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
im trying this. but at the Triggers i cant point it to the Menu, i only can point it to the content placeholder
..?
|
|
|
|
|
|
hiiiiiiiii
i have a situation where i have to select a row in gridview on single mouse click and when i click the delete button the selected row should be deleted. on double click only the selected row values should be loaded into the asp controls.for the double click i had written the code in row databound as
e.Row.Attributes["ondblclick"] = (ClientScript.GetPostBackClientHyperlink(this.gv1_Country, "SELECT$" + e.Row.RowIndex));
and by this i stopped the single mouse click to the datagrid.
when coming to single mouse click i had taken a hiddenfeild value and i want to assign the selected row primary key to that hidenfeild value.
for that i had written the code in row databound as
e.Row.Attributes.Add("onclick", "document.getElementById('hiddenfeildid').value=this.rowIndex");
and now the selected row index value is not coming into the hiddenfeild value.....
i hope all u understood my problem...
anyone kindly help me.............
Thanks in Advance....
VISHNU
|
|
|
|