|
Rank: Newbie Groups: Member
Joined: 9/24/2011 Posts: 9
|
Dear sir,
I have two text boxes in the Grid. One is Item Code and One is item Description. What i need is when i typied the item code then Item Description automatically cums in Item Description(from Database). I try in Grid1_ItemCommand but no success. Plz tell me in VB. Please help on that. Thanks.
Basit.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We won't write code for your particular requirement. Please try to abstract your question to specifically about a particular feature (for example, I did X and Y, according to the documentation X should happen but is not happening), we will be happy to answer those questions.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 9/24/2011 Posts: 9
|
Dear Sir,
I already wrote a code which is given below. What the problem is when i typied the item code in Item Textbox in the grid after leave column then the Grid1_ItemCommand is not fired. Please help on that. Thanks Alot. Basit
Private Sub Grid1_ItemCommand(ByVal sender As Object, ByVal e As EO.Web.GridCommandEventArgs) Handles Grid1.ItemCommand Dim Itm_Code As String = CStr(e.Item.Cells(1).Value)
Dim sql As String = String.Format("SELECT * FROM Mst_Item WHERE Itm_Code = '{0}'", ItemNo)
con.Open() Dim cmd As New OleDb.OleDbCommand(sql, con) dr2 = cmd.ExecuteReader() While dr2.Read e.Item.Cells(2).Value = dr2("Itm_Desx") End While dr2.Close() con.Close() 'End If end sub
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Your question is about why Grid1_ItemCommand is not fired. So you have to explain what you did to meet the condition to fire ItemCommand event. The reference for ItemCommand event clearly explained under what condition the event will be fired: http://doc.essentialobjects.com/library/1/eo.web.grid.itemcommand.aspxWhat you do inside your ItemCommand is completely irrelevant. So the code you posted has nothing to do with the question you are asking. Thanks
|
|
Rank: Newbie Groups: Member
Joined: 9/24/2011 Posts: 9
|
Dear sir,
Hi have two Text boxes, one is item code and one is Item description. What i need exactly is when i type the item code and when i leave this column then item description cums into item description text box. that's why i wrote a code in Grid1_ItemCommand Event. that's why need to write the raiseItemCommandEvent in java script to fire a Grid1_ItemCommand. But how write this command for text box control. Thanks Basit.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You can handle the GridColumns' ClientSideEndEdit event and then call raisesItemCommandEvent in your event handler. If you are not familiar with our client side API, You will need to take a look of our client side API first: http://doc.essentialobjects.com/library/1/clientapi_howto.aspxThanks
|
|
Rank: Newbie Groups: Member
Joined: 9/24/2011 Posts: 9
|
Dear sir,
I created the Javascript Code for
function on_TextBox_change() {
Grid.raiseItemCommandEvent(itemIndex, commandName) }
I call this event in ClientSideEndEdit, but the problem when i run the cursor is not move from the textbox. Thanks a lot. Basit.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I can see one obvious problem in your code is where you get the value of "Grid", "itemIndex" and "commandName" from your on_TextBox_change handler? These are Javascript code error that you will need to resolve yourself or find someone else to help you with. We only tell you where to look. We are not in a position to trouble your code. Please consider this issue closed as we have already clearly pointed you to what needs to be done in order to fire Item_Command event. Whether you have a problem in your code is something completely different and you will need to resolve such problems yourself.
Thanks!
|
|