|
What about
[0-9]{1,}
?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
hi,
.*[0-9].*[0-9]? would be one of them.
Or, String.LastIndexOfAny Method (Char[]) [^] would do.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
|
hi.
maybe
\d+
or something
greets
m@u
|
|
|
|
|
^[0-9] i am not sure... but it may be something like this one.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
A_Laxman wrote: ^[0-9] i am not sure... but it may be something like this one.
The correct one is [0-9].
The one you mentioned checks whether the string starts with any digit.
Thanks for the attention.
|
|
|
|
|
Thanks...
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
actually i dont know any usage and applications of enumarations can anybody explain me please
|
|
|
|
|
upadesh wrote: enumarations
Actually are called enumerations see there: [^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
upadesh wrote: i dont know any usage and applications of enumarations can anybody explain me please
Here is the most common usage:
foreach(object o in someEnumerableObject)
{
}
Unless you meant enum in which is it used to define a list of possible values from a well defined list.
When ShowDialog() completes it returns a DialogResult . There are only a small number of possibilities for the result including Okay, Yes, No, Cancel. Instead of forcing the developer to remember the integer values of each of these results the enum can be used to provide a more meaningful way of expressing the value.
|
|
|
|
|
you could use Code Search[^] to find some (a bazillion) usages of foreach, and analyze and interpret them.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Hi,
I am having an issue setting the column order on a grid:
I created a DataTable with some bound and some un-bound columns.
I created a DataGridView using the DataTable for input.
I set the .DisplayIndex for all the DataGridView columns
I then created a DataView using the DataGridView.DataSource
I assigned the DataGridView.DataSource to the DataView.
My columns to not appear in the correct order when first displayed, however, if I change the row filter on the DataView by responding to a GUI event, everything updates and my columns are in order.
Also, another table using only bound columns displays correctly the first time.
Has anyone had a similar issue or want to take a crack at this problem?
Thanks in advance,
Pualee
|
|
|
|
|
You can change column order by setting the DisplayIndex property.
Take in mind that no 2 columns can have the same index.
If the data is not very likely to change, you could manually add the columns in the datagridview via the IDE, and turn off autogeneratecolumns.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
I set display index as follows:
Int32 i;
i = 0;
dgvItem.Columns["X"].DisplayIndex = i++;
dgvItem.Columns["Y"].DisplayIndex = i++;
dgvItem.Columns["Z"].DisplayIndex = i++;
So I know I'm not duplicating indexes. I think autogeneratecolumns could get me in trouble (not sure) as I am constantly resetting the filter on the DataView and then resetting the DataGridView.DataSource = DataView. I do not know if this operation would clear and re-add the columns or not. I kind of expect it would since the columns come up wrong, but then correct themselves after changing the DataView filter the first time.
|
|
|
|
|
On second thought, I think you are right.
I have been trying to figure out how to eliminate the necessity of resetting all my column properties each time I update the filter. The columns will never change, just the records. If I manually add the columns and disable the autogeneratecolumns, I suspect I will only have to set the properties once and save a little bit of overhead when changing the records displayed...
Thanks!
|
|
|
|
|
Your welcome. Sometimes the IDE holds the key there are some other shortcuts you can take this way like making checkboxcolumns and the likes.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
hello all,
could some one tell me how could i bind the individual columns, already created to a dataset or a datatable during runtime.
thanks in advance.
Keshav Kamat
India
|
|
|
|
|
could you give us an example of what you're trying to achieve?
because binding different columns to different datasources doesn't make much sense to me. Might just be me though
Please clarify.
public object BufferOverFlow<br />
{<br />
__get { return BufferOverFlow; }<br />
__set { BufferOverFlow = value; }<br />
}
|
|
|
|
|
ya sure.
well here is my case.
i have a database, which has several columns. I need to modify the contents of a single column. Looking at a different side, binding a single column to a separate data source doesnt make sense to me either.
what I really want is to modify the contents of a cell of a column of a datagrid.
Can i do it using a datatable or a dataset, coz it is much faster, than accessing a datagrid as Datagrid1.Rows[i].Cells[j].
m trying to modify a cell. how to do it, if i bind a datagrid to a datatable.
Keshav Kamat
India
|
|
|
|
|
You can edit individual cells in DataTables in the same way as you edit cells in a DataGridView.
You can (or have to) use DataTable.Rows[i].Cells[j]...
public object BufferOverFlow<br />
{<br />
__get { return BufferOverFlow; }<br />
__set { BufferOverFlow = value; }<br />
}
|
|
|
|
|
well ok.
as u said in the previous replies,
when i try to bind a datagrid to a data table and try to access the cell or the row count of the data table, it says object reference not set. it comes null.
here is how i try to bind a datagrid to a datatable.
DataTable dt1=new DataTable("dt1");
dt1 = (DataTable)LoggerDatagrid.DataSource;
please tell me, if I am making a mistake anywhere.
thanks in advance.
Keshav Kamat
India
|
|
|
|
|
|
You're doing it the wrong way around.
It should be :
LoggerDatagrid.DataSource = dt1;
now your datagrid should be populated, and then you can start looking for cells to edit.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
I have some problems with destroying object after using.
1. How can I dispose the form with many events registered and some global fields that has to be destroyed? Or it will destroy automatically?
2. If my class registers some events from other objects (use +=), do I have to unregister all the events (use -=)on its Dispose() method? I afraid that the objects firing events will stay still in heap if I dont do that.
Thx for you answers.
|
|
|
|