|
I m using dataGrid control in my application. I want user to add records using Data Grid. Right now my Grid has 5 columns. Problem is that if user fills only one column and click add button, Grid does not add that row. Infact if i click on some other control that row from grid just disappeared. But if i fill all colums then a blank row appear down that row. and now if i click add button, this row will be added.
Now i just want a row to be added if i only fill one column. What should i do?
Day by Day Everyone is moving towards graveyard
|
|
|
|
|
Hello,
This is because the new row has not been committed in the datatable/datasource which you are using with DataGrid. You can write code in CurrentCellChanged event handler to assure that the changes you made in the datagrid are saved when you leave the cell.
HTH. Cheers.
Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
i am using C# windows appli,
i want my application to run automatically evry time when the user logs in.
please provide the sollution.
thank you in advance
sunny
|
|
|
|
|
Add path to exe file into Windows menu "Programs\StartUp"
or into registry
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run"
|
|
|
|
|
using Microsoft.Win32;
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run","MyApp", Application.ExecutablePath);
Was it a cat I saw?
|
|
|
|
|
i am using
commandobj.parameters.add(name,datatype,size).value=value;
to add the parameters to my stored procedures as my procedure takes 15 parameters, i have to write the code for 15 times i want to pass all the parameters at a single streatch is it possible,
if yes how?
sunny
-- modified at 1:37 Friday 7th April, 2006
|
|
|
|
|
commandobj.Parameters.AddRange(new SqlParameter[] { new SqlParameter("aaa", "bbb"), new SqlParameter("ccc", "ddd") });
Was it a cat I saw?
|
|
|
|
|
Hi,
I have treeview which contains parent and child nodes.
Child nodes contains html documents.
if user click on child node then it will display corresponding html document.
up to here it's working fine.
if user clicks continuously on child nodes,it is not displaying corresponding documents.So i want to prevent them to don't click upto whole document loding.
how can i do this ,any one help me out.
thank u
pavana
|
|
|
|
|
Is this a winform application?
|
|
|
|
|
hi,
yes it is winform application
|
|
|
|
|
Hi
I hope you will call a function to load the html document on click of the TreeNode. You might be using Treeview_Afterselect or Treeview_click event. What you can do is You can put this code before calling that function.
this.Cursor =Cursors.WaitCursor ;
trv.Enabled=false;
// You will call the function to load html file here
trv.Enabled=true;
this.Cursor =Cursors.Default ;
Hope this helps
|
|
|
|
|
I am using Directory.GetFiles to get an array of all the files in a directory. As far as that goes all is well. But, I need to know just the name of the files, not the whole path to the file. I was trying to us RegEx to search each file path and remove the path but I don't know how to do so universally as I don't know the exact path of the files all the time. Any ideas would be great.
Thanks in advance!
|
|
|
|
|
Use Path.GetFileName(String path).
In namespace "Path" you can find many usefull functions
|
|
|
|
|
OR you could just strip the directory info from the names...
for(int i=0; i
|
|
|
|
|
Hi there,
Iam newbie for c# i like to know how we can load an xml file and read the node inside the xml file earlier my application use to call another appl to get txt file and read the node inside the text file. now i want to pass the xml file instead of the appl so the following are the existing code pls advice how i can do it
Crosswalk_Holdings.Holdings ObjHoldings = new Crosswalk_Holdings.Holdings();
string strresponse ="";
string strMarctxt = "";
XmlNode ObjMarcTxtNode;
//by me 8/2/06
//strresponse = ObjHoldings.SendReceiveXML("http://203.78.8.89/scripts/vista/usmarc11.pl",strBIDNoForHoldings);
XmlDocument ObjXMLHoldings = new XmlDocument();
ObjMarcTxtNode = ObjXMLHoldings.SelectSingleNode("//USMARC/TXT");
if(ObjMarcTxtNode!=null)
{
if (ObjMarcTxtNode.InnerText.Trim()!="")
strMarctxt=Server.HtmlEncode(ObjMarcTxtNode.InnerText);
}
if (strMarctxt !="")
{
string tmpspace = "\n" + " ";
strMarctxt= strMarctxt.Replace(tmpspace, " ");
string strControlNo = ObjHoldings.ParseXML("008 |", strMarctxt).ToString();
if (strControlNo.Trim()!="")
strRecLanguage= strControlNo.Substring(35,3);
string strNativeDelimiter = " ";
//Native Identifier
//ISBN
string strNativeISBN = ObjHoldings.Parse880XML("|020-",strMarctxt).ToString();
//'ISSN
string strNativeISSN = ObjHoldings.Parse880XML("|022-",strMarctxt).ToString();
if (strNativeISBN.Trim()!="" || strNativeISSN.Trim()!="")
{
strNativeIdentifier = (strNativeISBN.Trim().Length>0?strNativeISBN + strNativeDelimiter:"") + strNativeISSN.Trim();
strNativeIdentifier = strNativeIdentifier.Replace("|","");
}
pls advice how i can pass the xml file instead of the url and get info or tag 020 and 022 from the xml file.
we have tag 020 and 022 in the xml file.pls advice
|
|
|
|
|
HI,How to save the text of listbox in hashtable or in xml?
Now I have a Item of listBox,when I select the Item how to save the text of Item?
Sorry,I am poor in English.
Code code code...
|
|
|
|
|
you can retrieve text by using
myListBox.SelectedItem.Text
property. Do you also need a code for putting it into xml file? search codeproject. there's a bunch of useful articles about that.
|
|
|
|
|
I am making a control (named mainPanel) derived from System.Windows.Form.Panel and it contains another Panel on the bottom. I want to achieve this function: When I drag a control into 'mainPanel',the control will be added into the inner Panel in it. It has confused me for some days.... Thanks
|
|
|
|
|
I get an error with the compiler each time I try to do this:
public interface IBehavior
{
...
}
public interface IBehaviorActing
{
IBehavior Behavior
{
get;
}
}
public class Behaviorclass : IBehavior
{
...
}
public class Itemclass : IBehaviorActing
{
public Behaviorclass Behavior
{
get {...}
}
}
The compiler say the Itemclass does not implement interface (wrong return type - Meaning not defining explicitly public IBehavior Behavior in Itemclass). Is there a pattern or another way around this?
|
|
|
|
|
Well, you didn't mention your intention why you want to return Behaviorclass in Itemclass. But I would say that I think you can still do whatever you want, using IBehavior return type (instead of Behaviorclass).
If you want to use the return type as Behaviorclass (instead of IBehavior), you can up-cast it later, like: Behaviorclass bc = SomeInstanceofItemclass.Behavior as Behaviorclass;
Hope it helps
Best Regards,
Ferry Mulyono
"If you can't bring Mohammed to the mountain, you got to bring the mountain to Mohammed" - Gil Grissom, CSI
|
|
|
|
|
The problem is that the interface says the Property has to be of type IBehavior and not Behaviorclass. To have a typesafe accessor in Itemclass and still adhere to the interface do the following:
public class Itemclass : IBehaviorActing
{
public Behaviorclass Behavior
{
get {...}
}
IBehavior IBehaviorActing.Behavior {
get { this.Behavior; }
}
}
The compiler will call the normal Behavior property whenever you access Behavior via the concrete class. Whenever it is accessed via an interface variable it will access the interface implemenation (which in turn calls the typesafe one).
I regulary use these constructs. It's also extremely useful when working with the ICloneable interface.
|
|
|
|
|
can you tell me where to find an example, with code, of a scientifc calculator, in Csharp, that has these functions too - BIN, OCT, HEX, DEC number transformation?
Ronald24
|
|
|
|
|
I'm having a problem with scaling GIF images down without getting pixelation. I am using HighQualityBicubic interpolation with HighQuality smoothing.
Converting the images to JPG seems to work fine, but saving to their native format produces undesirable image quality.
Any ideas on how I might clear this obstacle?
Thanks,
Robert K
|
|
|
|
|
We're working on a project that goes against another application that exposes it's API via web services. Pretty cool, except for the complexity of actually getting anything done due to the interdependacy of the calls.
So what we're doing is writing wrapper classes to abstract away the details to let people call a simple function that takes care of all the nitty gritty bits. Plus give us the future option of moving to another third party app by simply rewriting the wrappers.
Now for the problem area... we want to hide the actual web service calls from the application programmers using our wrapper. Basically we want to try to prevent someone from going outside the sandbox and using the API directly, potentially causing problems with the app or future portability. With them referenced in the assembly, you can see them by default. I know it's probably basic, but haven't worked out how to make them private or internal.
Someone got a pointer?
|
|
|
|
|
You can create this wrapper in an external project (into single DLL Assembly) to prevent programmers from seeing those. You can even obfuscate it to add more protection.
But there is one thing I would suggest, is that are you sure the details (such as service address, WSDL, etc) won't change? If you're sure, then it's quite straight forward. But if you're not sure if the service address won't change, maybe you can "extract" the service address to be read from an external configuration. As for the WSDL uncertainty, I'm not quite sure about that, but maybe you can write your own WSDL&SOAP parser
Hope it helps
"If Mohammed won't go to the mountain, then the mountain must go to Mohammed" - Gil Grissom, CSI
|
|
|
|