|
mmm I think you can do what you need if:
TextBoxOnFocus()
{
if (NumericPadDialog.ShowDialog() == Response.OK)
{
TextBoxOnOK();
}
}
and in your NumericPadDialog you must make the OK button work as close (or hide) and return the Response.OK, probably this button already does the exit or hide, you just need to add the Response, just notice how to play with dialog Modal mode. Well that is the idea.
|
|
|
|
|
Thanks for your reply.
I use the TextBox OnFocus event to call a function that sets some variables used by the NumericPad to know who is the caller and then shows the NumericPad.
This function is used by all the textbox in the application so it has no reference with the specific code executed in the TextChanged event of each textbox (that is different one from the other).
For this reason I think that your solution is not suitable to my problem but thank you anyway for your efforts.
|
|
|
|
|
Cool, I see...
Then I think you must use a Delegate, then in your onFocus you assign the current delegate to the action of you textBox OK, and in the OK event of the NumericPad you call the delegate... of course in your delegate method you will need to handle the release of the Delegate after a click (be sure to release it, you don't want to have a different textbox to trigger the OK of another textbox)
At this moment can not give you a code snipe, will try later...
|
|
|
|
|
Thank you.
I'm not sure I understood well what you mean.
I try to explain in more detail what I do.
In a form, call it FormA, I have four TextBox and in the Load event of the form I assign a delegate to the GotFocus event of the TextBoxes:
AddHandler (AutoIncTB.GotFocus), AddressOf FormMain.TB_GotFocus_1_MAX_RIP
AddHandler (RipTB.GotFocus), AddressOf FormMain.TB_GotFocus_1_MAX_RIP
AddHandler (DuratFinaleHTB.GotFocus), AddressOf FormMain.TB_GotFocus_0_23
AddHandler (DuratFinaleMTB.GotFocus), AddressOf FormMain.TB_GotFocus_0_59
In FormMain there are some functions TB_GotFocus_XXXX that assign different values to some variables and then show the NumericPad.
Public Sub TB_GotFocus_0_23(ByVal sender As System.Object, ByVal e As System.EventArgs)
CGlobali.ValoreCambiato = False
Ctrl(0) = sender
Ctrl(1) = 0
Ctrl(2) = 23
PhBt.Focus()
Tastiera.ShowDialog()
End Sub
The NumericPad "reads" the variables and understands what is the TextBox from which it was called and other things.
Using the NumericPad I can write in the TextBox.
Each TextBox has its own TextChanged event that is fired any time I write a digit, not when I push the OK button unless I write something also with the OK button (and this is what I do in this moment... but I could also use a flag... mmmm....).
You talk about textbox OK, did you mean the TextChanged event?
I hope this can explain better what I'm doing.
|
|
|
|
|
function GetEqrDataUploadFiles()
{
var upload=$("#files").data("KendoUpload");
var s = upload.wrapper[0].childNodes[2].childNodes.length;
var a = new Array();
for (i = 0; i < s; i++)
{
if (document.all) {
a.push(upload.wrapper[0].childNodes[2].childNodes[i].innerText);
}
else {
a.push(upload.wrapper[0].childNodes[2].childNodes[i].textContent);
}
}
return a;
}
|
|
|
|
|
If I'm not mistaken that looks more like Javascript.
If so then I think you will get a better answer in this forum Javascript[^]
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
As the previous reply indicated -- this is Javascript -- and it is using -- most likely jQuery.
I am responding because -- this snippet is accessing the DOM and making assumptions that are causing it to fail -- without grace and without any real way to provide much information, but -- the exception seems to indicate that the node being accessed is not present.
This is not a good way to find the element in question and the code has been written in an odd manner because the author has not taken the time to understand nodes -- if you do not do this, your only options moving forward are to write code like this and hope for the best, or abdicate the responsibility by using a 3rd party client side library for that.
To make matters worse, this issue of textContent vs. innerText -- is a well known difference between browsers and how they view whitespace in documents -- particularly XML documents.
It behooves a developer to take the responsibility of learning how to walk the DOM themselves and to check for null -- at least once. How do you know where you are in the DOM otherwise?
This script -- needs a lot of work to be robust --
|
|
|
|
|
I'm looking for architectural advice for rewriting a small-business point of sale app that accesses both a remote SQL database and a local MySQL database. My biggest point of indecision lies in deciding what to use to access the remote database. I've been doing research, and have learned that I can use WCF, Web API, or simply use a good old fashioned .Net web service which is what is being used today via COM interop. I could simply remove the interop layer, and rewrite the service on the newer framework. This sounds good to me since I have experience with web services. Also, I do not need the ability to access the service from multiple platforms, as all of our stores will be operating on Windows 7 machines and I can install whatever I want on them. Performance is important but we only have in the neighborhood of 150 to 200 users accessing the SQL server at any given time. I want to do this right (I've been a developer for many years but not an architect!) and I have as much time as I need. I don't want the finished product to be obsolete as soon as its written. Oh, and one more thing...LINQ or not? Lots of complex queries in our app covering many tables per query and the local store database table names are dynamic - prepended with the current date. The remote database tables have fixed names. Any advice would be greatly appreciated.
|
|
|
|
|
Make sure you write ~90% code coverage of the code in unit tests and your solution is unlikely to become obsolete.
Don't create dynamically named database table names. Not even locally. You will drive yourself insane trying to verify what should be happening at any point in time. Perhaps what you really need is a message queuing system instead? Look into MSMQ, SQL Server Service broker, or similar.
|
|
|
|
|
Little late maybe.
I use the good old adodb connection and recordset in .NET to access a remote MySQL database (Using IP-address as server).
Fast enough for me.
|
|
|
|
|
how to import .dat file into database table
|
|
|
|
|
|
You first have to know the format of the data in the file. ".DAT" is just a filename extension. It has no meaning and no impact on the format of the data in the file.
You either KNOW the exactly how the data is stored in the file or you need to find out. Without that, your project is dead before you even begin.
|
|
|
|
|
Hi All,
I am looking for expert advice on printing the pdf files at client machine.
I have created a sample project named ClientPrint as
Imports System.Drawing
Imports System.Drawing.Printing
Imports System.Runtime.InteropServices
Namespace ActiveX
Public Interface IActiveXPrintLib
Sub PrintFile(filePath As String)
End Interface
<ProgId("ActiveX.PrintFile")>
<ClassInterface(ClassInterfaceType.AutoDual)>
<ComVisible(True)>
Public Class ActiveXPrintLib
Implements IActiveXPrintLib
<ComVisible(True)>
Public Sub PrintFile(filePath As String) Implements IActiveXPrintLib.PrintFile
Dim AcroPdf As New AcroPDFLib.AcroPDF()
AcroPdf.LoadFile(filePath)
AcroPdf.printAll()
End Sub
End Class
End Namespace
I have created the dll and register the dll using regasm command on client machine.
Now at time of consuming the print method at client side using javascript as
<object id="myControl1" name="myControl1" classid="clsid:ActiveX.ActiveXPrintLib"> </object>
var axComponent = new ActiveXObject("ActiveX.ActiveXPrintLib");
alert(axComponent);
if (axComponent == null) {
alert('Probably not installed');
}
else {
yourAxComponent.PrintFile('<%= Page.ResolveUrl("~/PdfTemp/0d818b57-9384-4f52-ae89-8ef5868064b7.pdf") %>');
alert('yes');
}
I am getting the error that automation server can't create object, using IE I have enabled the active x and permisssions to download the activex. but it still gives me same error.
I am not sure whether my code is correct or not.
Any advice is really helpful.
Thanks in advance.
Sachin Mehndiratta
mehndi.sachin@gmail.com
|
|
|
|
|
|
Hi,
Thanks for sharing the link, but information shared on this link is not complete and still I am facing same issue.
Thanks,
|
|
|
|
|
Why we need Attribute in .net application ? Please give any real time example.
Thanks in Advance
|
|
|
|
|
Attributes allow us to decorate something, e.g. a class, with something that indicates to a piece of calling code that this particular thing has certain behaviour. While the operation can appear magical at times, e.g. how does marking a class as Serializable mean it can be serialized, there is always a piece of code at the other side that is checking to see if the attribute exists and acting on it if it's present. Serialization is a great example of the practical use of attributes. As well as marking a class as being capable of serialization, we can use additional attributes to say that certain types in that class should not be serialized. Then, when you attempt to serialize the class in your code, the underlying serialization engine determines that the class can be serialized but it has to ignore certain members in it.
|
|
|
|
|
|
What else you suggest ? Whats problem with Attribute ?
|
|
|
|
|
Hi
i have created DataGrid and i need to align the specific column (4th column i.e index 3) to Center in C# programmatically.
I tried as below
dg1.Columns[3].ItemStyle.HorizontalAlign = HorizontalAlign.Center;
but giving error as follows
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
even if i give index 0 also same error
How to achieve this. If anybody knows reply me.
Thanks in advance.
|
|
|
|
|
ven753 wrote: even if i give index 0 also same error
That means that your columns have not yet been created at that point.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
No i have dataset and i am adding datasource to datagrid and binding as follows.
dg1.DataSource = ds1.Tables["tblanni"].DefaultView;
dg1.DataBind();
in ds1 4 columns is there and after binding to datagrid same column i will get in datagrid.
Then how to achieve this. Please reply me.
|
|
|
|
|
Change the alignment AFTER binding - the datageridview does not have the columns at the point where you are accessing them. If it did, the index would not be out of range.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I added after binding then also its giving same error.
dg1.DataSource = ds1.Tables["tblanni"].DefaultView;
dg1.DataBind();
dg1.Columns[3].ItemStyle.HorizontalAlign = HorizontalAlign.Center;
What to do. Please reply me.
|
|
|
|