|
Hello,
I have put a combo box on a form in VB.NET; which will be populated through oracle table "PLACENAMES". I wish that when a user types the name of place in the combo box the relevant / like place names should be auto dropped down for his selection, and if it is a new place name then this new place name should be saved in the table on pressing the enter key.
Please guide me how to achieve this feature.
Thanks & Regards
Girish
|
|
|
|
|
For solving your first query, set the following properties of combobox :
cboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
cboBox1.AutoCompleteSource = AutoCompleteSource.ListItems
and for 2nd query follow these steps :
1. Handle KeyUp event and catch for Enter Key.
2. If enter key is pressed then check if selected value of combobox is nothing
means, item does not belongs to list.
3. If item does not belongs to list then code your logic for adding it to database.
|
|
|
|
|
Thanks for your valuable answer.
Meanwhile I placed a new textbox i.e Textbox11 and code like following: (invrst is my ADODB.recordset name)
Private Sub TextBox11_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox11.TextChanged
Dim strField As String = "PLACENAME"
ComboBox4.Items.Clear()
If TextBox11.TextLength = 0 Then
ComboBox4.Items.Add("<blank>")
ComboBox4.DroppedDown = False
ComboBox4.MaxDropDownItems = 4
Me.Cursor = Cursors.Arrow
End If
If TextBox11.TextLength <> 0 Then
invrst.Filter = strField & " like '" & Trim(TextBox11.Text) & "%'"
invrst.MoveFirst()
Do While Not invrst.EOF
ComboBox4.Items.Add(invrst.Fields(0).Value)
invrst.MoveNext()
Loop
ComboBox4.DroppedDown = True
ComboBox4.MaxDropDownItems = 4
Me.Cursor = Cursors.Arrow 'It is mandatory because setting droppeddown=true case mouse pointer to hourglass
End If
Me.Cursor = Cursors.Arrow
End Sub
I am trying to achieve the feature like address bar of browser i.e. if there is reference of visited page then it comes to the top of list otherwise it will be appened in the cache list.
In the above code, problem is if there are more items in combobox is dropped down over other controls of the form and looks bad; even i have set MaxDropDownItems=4.While;
ComboBox4.AutoCompleteMode = AutoCompleteMode.SuggestAppend
ComboBox4.AutoCompleteSource = AutoCompleteSource.ListItems
is working fine but two problems:
1.I am not able to write the code for add a new place name in the table.
2.I click on combobox and then type few chars in the combobox then another list comes over main list area and it makes something confusing.
Please quote your valuable views.
Thansk & Regards
Girish
|
|
|
|
|
I have a requiredfield validator in my form which is not firing at all while clicking on the Submit button. The CausesValidationProperty is true for the button control. The rfv is checking against a textbox and that is also set correct in the rfv property. However, the star appears after the postback. Any idea what's happening? Am I doing anything wrong here? Please help.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Is the CausesValidation property for the textbox set to true ?
|
|
|
|
|
Yes. It is set to True.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Ideally it should work when you have a text box attached to a RFV. Make sure that the button is not calling a client side javascript which in turn submits the page...
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Hi,as of my understanding related to ur message I hope u haven't set any error message property for the RFV control.So u r unable to see any message even after the page post back happens(means the validation done).Try to make it.
I hope it helps.
If not can u clearly post the question on what ur troubling?
|
|
|
|
|
how to perform an action against the mouse click on the header of the c#asp.net gridview's column.
|
|
|
|
|
Simpler work around for this is
var vTh = document.getElementsByTagName("th");
for(var i=0;i<vTh.length;i++)
{
vTh[i].onclick=yourmethod;
}
But make sure that your html doesn't contain anyother THs, if so add your own logic to restrict it inside the for loop.
|
|
|
|
|
can u plz tel me how this code snippet is working.
|
|
|
|
|
in row databound event you will have to write something like..
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", "javascript:ChangeRowColor('" + e.Row.ClientID + "')");
}
and changecolorfunction in javascript with what ever you want to do....
umerumerumer
|
|
|
|
|
Gridview column headers are nothing but THs in the html generated.
In the body load you have to put that code which will loop through the list of Ths in the document and associate onclick event for all of them.
|
|
|
|
|
but it is not recognizing 'var'
|
|
|
|
|
This code needs to be registered on page load.
TableObject.rows[0].onclick = Function("return YourFunctionName(this);");
Here
TableObject is ur gridview object
rows[0] gives the first row that is the header row.
Then write ur logic in "YourFunctionName"
Regards
Santhosh N
|
|
|
|
|
helllo,
how can i create a folder in the client side from server side and put in his content a folder named images that contain all images relative to a specific document.
i tried to make it shared and it was worked properly but the big problem is :
if any other user has access to the shared folder he can see all images.
How can i forbide the access of users to the shared folder, or is it any other solution to copy this files.
Can we an image or save it in the cache as an object.
regards
dghdfghdfghdfghdgh
|
|
|
|
|
.landscape
{
width:100%;
height:100%;
filter:progid:DXImageTransform.Microsoft.BasicImage(Rotation=3);
}
This is class of css file.
we have to be define this class at that div which we have require in landscape formate.
This code is use for landscape print when we click on form print button but it code is perform only for single page.
When we have two or more pages this code is never work properly.
Using this code the record is overflow.And when we click on print button we get one or more copies of one single page.
So we have to be require landscape print for one or more pages when we
Use window.print().
|
|
|
|
|
hi dear,
i have a small problem. how do we will send database to server through FTP. i.e directly that App_data send into our folder or Log file. I have .NET Hosting.
thank you
j somasekhar
|
|
|
|
|
somasekhara777 wrote: how do we will send database to server through FTP
You either detach the database from your local system then FTP the MDF and LDF files to the server, or you make a backup of the database on your local system and FTP the backup file to the server then restore it on the server.
somasekhara777 wrote: directly that App_data send into our folder or Log file
somasekhara777 wrote: I have .NET Hosting
You will need SQL Server hosting too.
|
|
|
|
|
ASALAMOALEKUM All, hope everyone is doing fine... code project is a good source to resolve problems and everytime i have believed this source it never disappointed me thats why i always feel free to post my problem here after trying hard to solve myself... thanks to team and all the membersss here..
current problem:-
Please if anyone has any good idea about my question please do guide me coz i have tried many ways to accomplish my task but time is running and my dead line date is very near and my task is still uncompleted!
I have to implement video conferencing in my web based project!
i am using asp.net along with c#.
in this regard if any one can guide me which API i should use, or any com component or ActiveX control pleaseeeeeee help me out... i am really helpless nowwww. few of com components i knew i have tried them but they are not working on web app.... please please reply and suggest any good tutorial in this regard.
thanks,
regards,
SANA
$@N@
|
|
|
|
|
If an ActiveX control is created in .Net and is used on a Asp .Net page does the client need to have the .Net framework installed in order for the control to work?
|
|
|
|
|
Yes, if the ActiveX based on .NET Framework.
you should use ATL if you want to clients access normal without .Net Framework
Glad to discuss with you and best wishes.
|
|
|
|
|
|
Hi i am doing an web application , in which i have to disable the back button using the C# code.
can you please help me??
else, can any one tell some coding in the asp side so that i can paste directly in the page??
|
|
|
|
|
You may have to solve this with some Javascript, so that you can trap the user when they press the Backspace Key on the keyboard.
function fOnKeypress() {
try {
var charCode = window.event.keyCode;
if (charCode == 13) {
window.event.keyCode= 9;
}
}
catch (er) {
}
}
You will need to load this in the BODY OnLoad event. I'm usign something like this:
var objForm= document.getElementById("aspnetForm");
objForm.onkeydown=fOnKeypress;
|
|
|
|