|
You should use DataGrid. It has edit, insert and delete function itself.
|
|
|
|
|
hisen wrote: You should use DataGrid. It has edit, insert and delete function itself.
Thanks! Should I save information with SQL Server CE or XML ?
Can you please point me to information where I can learn to do those operations?
|
|
|
|
|
I think you needn't. But it depend on your project specfic request.
|
|
|
|
|
|
|
Hello,
Can anyone explain me how to build ListView from SQL Query? (MS SQL Server)
|
|
|
|
|
Hi all,
I have an xml file that I want to make a small app to present its contents in a convenient way to the user. Nothing especially fancy is needed here - a pane for a treeview so the user can select what he or she wants to look at, a panel for displaying the selection(s), and the facility to load the file in the first place.
I'm thinking this would be a good time for me to get familiar with linq2xml (linq noob here), but wanted to see if there were other equally-or-better good routes to go as well.
Thx!
-sff
|
|
|
|
|
sherifffruitfly wrote: a pane for a treeview
Why not simply load the whole XML document into the TreeView?
|
|
|
|
|
No major reason - I just think of treeview data situations a 2-paned affairs is all. Possibly that's an out-moded frame of mind.
I was more interested in alternative methods of getting the data to the app in the first place though, I can fiddle with it once it's there in a variety of ways.
|
|
|
|
|
Hello, I do not know why it is happening, but sometimes DateTime.Substract returns either 0 or 1, while parameter have same values
public bool bCodeChange1;
public bool bCodeChange2;
private DateTime RemoveTime(DateTime time)
{
time = time.AddHours(-time.Hour);
time = time.AddMilliseconds(-time.Millisecond);
time = time.AddMinutes(-time.Minute);
time = time.AddSeconds(-time.Second);
return time;
}
private void dateTimePickerDateDeadLine_ValueChanged(object sender, EventArgs e)
{
DateTime dtDateDeadLine = dateTimePickerDateDeadLine.Value;
DateTime dtDateReciet = dateTimePickerDateReciet.Value;
dtDateDeadLine = RemoveTime(dtDateDeadLine );
dtDateReciet = RemoveTime(dtDateReciet );
if (dtDateRecit >= dtDateDeadLine )
{
MessageBox.Show("DeadLine need to be at least one day ahead of Reciet", "Račun", MessageBoxButtons.OK);
dateTimePickerDateDeadLine.Value = dtDateReciet.AddDays(1);
return;
}
if (bCodeChange2)
{
bCodeChange2 = false;
return;
}
bCodeChange1 = true;
numericUpDownDaysTillDeadLine.Value = dtDateDeadLine.Subtract(dtDateReciet).Days + 1;
}
private void numericUpDownDaysTillDeadLine_ValueChanged(object sender, EventArgs e)
{
if (bCodeChange1)
{
bCodeChange1 = false;
return;
}
bCodeChange2 = true;
numericUpDownDaysTillDeadLine.Value = dateTimePickerDateReciet.Value.AddDays(Convert.ToDouble(numericUpDownDaysTillDeadLine.Value));
}
I am so puzzled. Thanks goes in Advance.
PS: If variables names missmatches, you do not need to point out, because i nearly translated variable names, so that you can understand.
|
|
|
|
|
Saksida Bojan wrote: numericUpDownDaysTillDeadLine.Value = dtDateDeadLine.Subtract(dtDateReciet).Days + 1;
In your example above this should return zero, as the Subtract() method returns -1; dtDateDeadLine is smaller (i.e. less than) dtDateReciet . If the dates are equal then Subtract() will return zero giving a final answer of 1.
|
|
|
|
|
Saksida Bojan wrote: i nearly translated variable names
not a good idea in general
One problem you have is DateTime contains time up to a single tick, that's a tenth of a microsecond.
To strip the time, just use DateTime.Date
In general, when in trouble with a particular class, read the first 3 MSDN pages about that class, including the list of methods, properties and events.
|
|
|
|
|
Thank you, it worked like a charm.
|
|
|
|
|
you're welcome.
|
|
|
|
|
Good afternoon.
I was wondering if there is a more efficient way to write this code:
if (cboSP_Site.SelectedIndex == -1 && inttmpSP != -1)
{
WebBrowser1.GoBack();
}
else if (cboWS.SelectedIndex == -1 && inttmpWS != -1)
{
WebBrowser1.GoBack();
}
else if (cboFolder.SelectedIndex == -1 && inttmpF != -1)
{
WebBrowser1.GoBack();
}
I want to call the WebBrowser1.GoBack(); once if possible.
Thank you, WHEELS
|
|
|
|
|
Wheels012 wrote:
I want to call the WebBrowser1.GoBack(); once if possible.
Do nested If
if (cboSP_Site.SelectedIndex == -1)
{
if (inttmSP != -1 || inttmpWS != -1 || inttmpF != -1)
WebBrowser1.GoBack();
}
I hope i did it correctly
|
|
|
|
|
Saksida Bojan wrote: I hope i did it correctly
Not really. Every letter counts here.
|
|
|
|
|
there are many ways to get what you want, here is one:
if ((cboSP_Site.SelectedIndex == -1 && inttmpSP != -1) ||
(cboWS.SelectedIndex == -1 && inttmpWS != -1) ||
(cboFolder.SelectedIndex == -1 && inttmpF != -1)) {
WebBrowser1.GoBack();
}
and another one:
bool goBack=false;
if (cboSP_Site.SelectedIndex == -1 && inttmpSP != -1) goBack=true;
else if (cboWS.SelectedIndex == -1 && inttmpWS != -1) goBack=true;
else if (cboFolder.SelectedIndex == -1 && inttmpF != -1)) goBack=true;
if (goBack) WebBrowser1.GoBack();
BTW: here the "else" keywords are optional
modified on Monday, November 30, 2009 4:23 PM
|
|
|
|
|
Thank you Luc.
if ((cboSP_Site.SelectedIndex == -1 && inttmpSP != -1) ||
(cboWS.SelectedIndex == -1 && inttmpWS != -1) ||
(cboFolder.SelectedIndex == -1 && inttmpF != -1)) {
WebBrowser1.GoBack();
}
Is what I am looking for. A little slow today.
WHEELS
|
|
|
|
|
5 years from now, you'll probably be scratching your head over what this code does. At the risk of being chastised for writing more code, I suggest you amend the code to:
bool itemDeleted = (cboSP_Site.SelectedIndex == -1 && inttmpSP != -1) ||
(cboWS.SelectedIndex == -1 && inttmpWS != -1) ||
(cboFolder.SelectedIndex == -1 && inttmpF != -1);
if (itemDeleted) {
WebBrowser1.GoBack();
} /ravi
|
|
|
|
|
|
that's why I offered some alternatives, you pick whichever you like most.
|
|
|
|
|
Thank you ravi. Good code. WHEELS
|
|
|
|
|
Is there a split container control that will allow the user the ability to resize the control during the applications runtime environment. And will allow for more than 2 split panels. As the SplitContainer control I can only see it allowing 2 containers. I need at least 3 or 4 containers to be resizable. Without having to next the containers inside each other.
|
|
|
|
|
AFAIK nesting SplitContainers is the normal approach.
The alternative could be a TableLayoutPanel, but then IMO you have to organize the resizing handles and everything yourself.
|
|
|
|