|
hello for every one
i think this is a tough question cause even people in the J# forum couldn't solve it
without getting into unnecessary details here is the problem
ID Item
101 pencil
102 pen
assume we have a datagridview just like above and it is not bound to a database , how can i get ID values(101,102) into code variables so that i can use them. and if possible how can i make sure that id values would be unique and of course not null ?
thanks in advance
|
|
|
|
|
ahh sorry mate but I have a question for you, why would anyone wanna do such a thing????
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
man i don't know what to say, i do not want to waste ur time trying to understand my mproject logic it is just a question if u have the answer please give if u don't ....
iam waiting for u experts
please help
thanks in advance
|
|
|
|
|
well the way you put it no buddy would even bother thiking about wasting his/her time on u even if they know the thing.
you can insert unique values in a datagridview without binding it to a database. but you have to bind it to a DataTable inside a Typed DataSet. You'll have to make a field and set its identity and auto increment properties for yourself. I hope you wont be asking how to do that and get a FREE note from some expert who is feeling to much obliged to offer his/her services to a guy like you for free,
mr.me wrote: how can i get ID values(101,102) into code variables
as far as getting the IDs from a gridview is concerned... it really a matter of traversing the right cells in the gridview. You can use a for loop cant you?
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
Rocky# wrote: well the way you put it no buddy would even bother thiking about wasting his/her time on u even if they know the thing.
it is just an simple example to make it easey for you and me
in fact iam not an expert and i need help. yes i admit that this is my first time dealing with gridviews, to let u know i have done my best trying to solve it ,searching MSDN , viewing articles and walkthroughs , J# forum. i still hope other people may help me out
the way u talk is very tough and i think that because of two possibilties
1.u r really expert but with a big head or a very big loser.
|
|
|
|
|
mr.me wrote: the way u talk is very tough
and what do you think about that
mr.me wrote: man i don't know what to say, i do not want to waste ur time trying to understand my mproject logic it is just a question if u have the answer please give if u don't ....
is that really a polite way to talk...
mr.me wrote: 1.u r really expert but with a big head or a very big loser.
well I aint got any thing to prove to u, if the thing I told you helped you, its nice otherwise it doesnt make any differnce does it.
by the way experts dont mind helping but what they do mind is spoon feeding someone. All I was asking was what you have done as far as the researching goes, if you had explained that a little bit more you would've had to listen to all that. but any way...
good bye
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
ok i'am sorry
we waste a lot of lines - and time - while i was looking for 1 line of code
|
|
|
|
|
hi all,
how to we set report heading at run time for crystal reports in windows application.
regards
os
|
|
|
|
|
Create a Page_INIT eventhandler for the Crystal Report
In that handler you can recreate the Header
|
|
|
|
|
Hi all,
I am not able to refresh the datagridview Control when i click on on callback button the gridview is populated with the callbacks and when i click on another button fresh calls it gives me ffresh cals but the datagridview is appending that data not refreshingg
i tried that dataset is nothing
Thanks
|
|
|
|
|
Hi,
first of all,
you have a Datagridview which is databound(), then you manually add data and after that you click a button.
What should this button do?
Just refresh() the data in the grid?
The grid is attached to a dataset, the dataset should acceptchanges() from the datagridview. ohterwise the original dataset is shown.
After the dataset is refreshed, should the added data be stored in the database?
|
|
|
|
|
I need some help with a Problem in a DataGridView.
I have a DataGridViewComboBoxColumn bound to a list of Strings to select from.
If I select one of this items, it should be removed from the other cells dropdown
lists (in the same ComboBoxColumn). So that only the not selected Items are available to choose from.
(If I simply shorten the bounded list, I get a "DataGridView ComboBox Cell Value not valid" error.)
This sounds very easy, but in fact I spended several hours and could not solve this simple
task so far!
Can anybody help me?
Thanks!
Update:
I also tried to use a Datatable as Datasource, but when I remove an Item from the Datasource it has also the effect that it disappears from the cell it was formerly selected.
Update2:
Ok, I just tried it again and got a working solution myself.
Instead of binding the whole ComboboxColumn to a DataSource, I bind every cell for itself to a Datasource( or list). I use the CellBeginEdit event to Update the cells DataSource with the available Items.
This seems to work well
modified on Saturday, March 15, 2008 4:29 AM
|
|
|
|
|
I have a combobox bound to a BindingSource, in turn bound to a DataTable of Agent Names. Everything is handled by the VS 2008 designer, i.e. I have no custom data binding code, nor do I have any code that sets anything on the combobox. Yet, when I start my project, I get the following error:
InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
|
|
|
|
|
Brady Kelly wrote: I have no custom data binding code, nor do I have any code that sets anything on the combobox.
Well normally I would offer some advice about things like understanding the technology you are working with rather than thinking one can just drag and drop their way to quality software products but I'm pretty sure you and I have had that conversation and you rejected it, yes?
led mike
|
|
|
|
|
This has sweet nothing to do with me not understanding the technology, but only an idiot would just quietly accept it if one of his tools exhibited repeatable, anomalous behaviour. It is as much a desire of mine to understand my tools as well as to have them behave not only as expected, but also as indicated by the documentation.
|
|
|
|
|
It might be that your combo does not have any data in it (count = 0) and so throwing an exception when you try to set the SelectedIndex to 0 (which is item 1 on the combo).
Maybe you should check the data source to see if it actually returns some values...
|
|
|
|
|
I know it returns values. This only happens when the Break When Thrown debugging option is enabled. MS are actually swallowing an exception, and I suspect the reason it actually breaks when thrown is because I have the debug symbols and source code for the ComboBox installed on my machine.
|
|
|
|
|
I have set the alpha values of the brushes and pen, why isn't it blending into the form?
http://img153.imageshack.us/img153/2372/ss0001cn7.png[^]
Is there anyway to do this correctly?
<br />
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
<br />
this.AutoSize = false;<br />
this.BackColor = Color.Transparent;<br />
<br />
Graphics g = e.Graphics;<br />
<br />
g.SmoothingMode = SmoothingMode.AntiAlias;<br />
g.CompositingMode = CompositingMode.SourceOver;<br />
g.CompositingQuality = CompositingQuality.HighQuality;<br />
<br />
LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, Color.FromArgb(alpha, Color.Gray), Color.FromArgb(alpha, Color.Silver), LinearGradientMode.Horizontal);<br />
g.FillRectangle(brush, this.ClientRectangle);<br />
<br />
Pen pen = new Pen(Color.FromArgb(alpha, Color.Red));<br />
g.DrawRectangle(pen, 0, 0, this.Size.Width - 1, this.Size.Height - 1);<br />
<br />
SolidBrush fontBrush = new SolidBrush(Color.FromArgb(alpha, Color.Black));<br />
g.DrawString("Crap", this.Font, fontBrush, 10.0f, 10.0f);<br />
}<br />
|
|
|
|
|
Hello,
Zerox MXI wrote: why isn't it blending into the form?
Because the Color.Transparent only means, that the Control shows the BackColor of the ContainerControl.
Apart from that, you have to care about your instanciated GDI object (Brushes, Pen, ...)!
They have to be" Dispose()";
You could call "fontBrush.Dispose();" or use a "using"- block:
using(SolidBrush fontBrush = new SolidBrush(Color.FromArgb(alpha, Color.Black)))
{
g.DrawString("Crap", this.Font, fontBrush, 10.0f, 10.0f);
}
Or hold the objects as long as the Control get's disposed and do the disposing there!
All the best,
Martin
|
|
|
|
|
As I am developing one windows application, I want to show one report to user. Previously iwas using datagrid but it dosen't solve the purpose as format of this report some thing like values in multiple rows and their respective totals. so I request you to please help me to create database driven dynamic table.
Thanx
Gurudatta B. Shelke
|
|
|
|
|
Hi,
You should try using the DataGridView control. It provides numerous basic and advanced features that are missing in the DataGrid control. Additionally, the architecture of the DataGridView control makes it much easier to extend and customize than the DataGrid control.
The following are the primary features available in the DataGridView control that are missing from the DataGrid control.
DataGridView control feature
Multiple column types
The DataGridView control provides more built-in column types than the DataGrid control. These column types meet the needs of most common scenarios, but are also easier to extend or replace than the column types in the DataGrid control.
Multiple ways to display data
The DataGrid control is limited to displaying data from an external data source. The DataGridView control, however, can display unbound data stored in the control, data from a bound data source, or bound and unbound data together. You can also implement virtual mode in the DataGridView control to provide custom data management.
Multiple ways to customize the display of data
The DataGridView control provides many properties and events that enable you to specify how data is formatted and displayed. For example, you can change the appearance of cells, rows, and columns depending on the data they contain, or you can replace data of one data type with equivalent data of another type.
Multiple options for changing cell, row, column, and header appearance and behavior
The DataGridView control enables you to work with individual grid components in numerous ways. For example, you can freeze rows and columns to prevent them from scrolling; hide rows, columns, and headers; change the way row, column, and header sizes are adjusted; change the way users make selections; and provide ToolTips and shortcut menus for individual cells, rows, and columns.
Below is small code snippet showing how we can bind the grid to a data source
BEGIN CODE
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'nwindDataSet.Customers' table. You can move, or remove it, as needed.
this.customersTableAdapter.Fill(this.nwindDataSet.Customers);
customersDataGridView.DataSource = nwindDataSet;
customersDataGridView.DataMember = "Customers";
customersDataGridView.Sort(customersDataGridView.Columns["ContactName"], ListSortDirection.Ascending);
}
END CODE
I hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
I am looking for a UI control where you can associate to any other control and as you mouse over the associated control, it will pop up to show more information or just about anything that I want to assign it to display. This control will remained visible until I move the mouse away from the associated control or the control itself. While the control is visible showing information, it can be updated to show some live results for instance progress of some value, etc.
I wonder if such a control have already existed or not and I won't have to reinvent the wheel if someone else had made it. If it's not, I guess I would have to make one for myself but unfortunately I'm not good at graphics related programming when it comes to winforms. I hope someone can point me to the right direction, probably some tutorials or certain articles in codeproject.com
Thanks in advance.
|
|
|
|
|
Zerox MXI wrote: I'm not good at graphics related programming when it comes to winforms.
In what context are you good at graphics related programming?
led mike
|
|
|
|
|
i "know" i did this once long ago, but for the life of me i can neither recall how nor find it on the web. any help would be greatly appriciated. (not sure if it's a IE7 vs IE 6 thing (im that lost))
i have a WebBrowser control on my form and i would like to invoke the "Send page by email" functionality. i tried stuff like this
<br />
int WM_COMMAND = 0x0111;<br />
int ID_IE_FILE_SENDPAGE = 279;<br />
m_NullPointer = IntPtr.Zero;<br />
m_hWBShellDocObjHandle = (IntPtr)0;<br />
<br />
HandleRef hr = new HandleRef(this.web, this.web.Handle);<br />
IntPtr ret = SendMessage(hr, (uint)WM_COMMAND, (IntPtr)ID_IE_FILE_SENDPAGE, m_NullPointer);<br />
Taken from here at the CP[^] )
and stuff like
<br />
web.Document.ExecCommand(......<br />
none work.
please point me the way
|
|
|
|
|
cechode wrote: i have a WebBrowser control on my form and i would like to invoke the "Send page by email" functionality.
Is there some problem with just sending the email using System.Web.Mail ?
led mike
|
|
|
|
|