|
I don't understand please forgive me. I am new to Datagridview grids. After I remove the row from datatable what do I need to do next? I read through your articles, but I am confused??
|
|
|
|
|
Can you show the code you are using add the row?
|
|
|
|
|
I created a DataSource with a DataTable in it and added it through the wizzard when I added the Grid to my form. When a user enters 0 in the first cell I want to remove that row from the grid.
I hope this helps
Thanks!
|
|
|
|
|
How are you adding the row after deletion? Since you are getting IndexOutOfRange exception, you should check all the indexes you are using while adding the row.
|
|
|
|
|
I am clicking on the first cell in the next available row when I receive the error. When I selected the datatable to use for the grid it created a binding source. When I try to execute the RemoveAt with the binding source it errors out.
Is there an easier way to do this?
|
|
|
|
|
I have never used a wizard for doing something like this. I had set the datasource through code and deleted the row using same code as yours. I added and new row as well and didn't received any error.
|
|
|
|
|
protected void btnAdd_Click(object sender, EventArgs e)
{
Response.Cookies[txtCookieValue.Text].Value = txtCookieValue.Text;
DropDownList1.DataSource = Request.Cookies;
DropDownList1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Cookies.Clear();
Request.Cookies.Clear();
DropDownList1.DataBind();
}
i have executed 1st method many times as to add more and more Cookies
and then i have executed 2nd method ones.This should Clear all items in deopdownlist1. but its not cleared
can anyone tell me why?
|
|
|
|
|
for (int i = 0; i < Response.Cookies.Count; i++)
Response.Cookies[i].Expires = DateTime.Now.AddDays(-1);
for (int i = 0; i < Request.Cookies.Count; i++)
Request.Cookies[i].Expires = DateTime.Now.AddDays(-1);
this is also not working
|
|
|
|
|
string[] c = Request.Cookies.AllKeys;
foreach (string co in c)
{
Response.Cookies[co].Expires = DateTime.Now.AddDays(-1);
}
this is working..
any idea why this approach is right and above 2 are wrong?
|
|
|
|
|
Can anybody explain to me how I handle the DataError Event? I have the
following code but the error does not get picked up by any of them. Looking
at e.Context shows " Parsing | Commit | CurrentCellChange ", how do I get
the individual values?
if (e.Context == DataGridViewDataErrorContexts.Commit)
{
MessageBox.Show("Commit error");
}
if (e.Context == DataGridViewDataErrorContexts.CurrentCellChange)
{
MessageBox.Show("Cell change");
}
if (e.Context == DataGridViewDataErrorContexts.Parsing)
{
MessageBox.Show("parsing error");
}
if (e.Context == DataGridViewDataErrorContexts.LeaveControl)
{
MessageBox.Show("leave control error");
}
|
|
|
|
|
Hi,
DataGridViewDataErrorContexts is an enum and has the FlagsAttribute, which means all members are really bit-oriented flags, so try this:
if ((e.Context & DataGridViewDataErrorContexts.Parsing)!=0) {
MessageBox.Show("parsing error");
}
PS: please use PRE tags to show code, as I did (see the difference?)
|
|
|
|
|
i have one form
this form have some of textbox& have button
if button clicked then we view form that consist of member
i want with Doublieclick IN row of datagrid Form one cell view in text box In Other FORM
HOW?
|
|
|
|
|
There are many ways that you can accomplish this; but one of the simplest is to have a delegate respond to your change.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
how can pass data from Form to Other Form
|
|
|
|
|
HI
Can any one kindly let me know how to generate the API Key for rest ful web services like linkedin, whats the best parctice for generating it, thanks in adavnace, kindly reply ASAP,
regards,
|
|
|
|
|
kingshez wrote: whats the best parctice for generating it
You can't generate it, one has to request it. The API-key of LinkedIn can be obtained here[^].
I are Troll
|
|
|
|
|
Thanks for your reply actually i am exposing my own API for my application and i want to know the best practices of generating API Key and Secret API Key just like linked or facebook do,
regards,
|
|
|
|
|
In general, one generates a unique number (based on a GUID, the date/time and/or a hash of the username) and send that by email. You'd have to keep a list of the email-adresses that match the unique number.
You can then verify the number/emailname combination in your webservice to determine whether the API-key is valid.
So, to define the best practices;
- Make sure that the identification-number is unique
- Use an emailaddress instead of a username
Hope this helps
I are Troll
|
|
|
|
|
hello all
my question is how to bind multiple isolated stored procedures to one crystal report?
regards in adavnce
|
|
|
|
|
You can use Dataset and fill tables in the dataset from different stored procedures, and finally bind the report to the dataset.
Regards,
Prakash Kalakoti
|
|
|
|
|
protected void btnAdd_Click(object sender, EventArgs e)
{
Response.Cookies["message"].Value = "Hello World";
Response.Cookies["message"].Expires = DateTime.Now.AddDays(1);
btnAdd.Text = Response.Cookies["message"].Value;
Button1.Text = Response.Cookies["message"].Value;
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Response.Cookies["message"] == null)
Button1.Text = "null";
else
Button1.Text = Response.Cookies["message"].Value;
}
when btnAdd)Click is executed it sets Button1.Text = btnAdd.Text = "Hello World";
but when Button1_Click is executed it sets Button1.Text = String.Empty.
Why?
|
|
|
|
|
hotthoughtguy wrote: if (Response.Cookies["message"] == null)
Button1.Text = "null";
else
Button1.Text = Response.Cookies["message"].Value;
refer the cookie from request object rather than response.
if (Request.Cookies["message"] == null)
Button1.Text = "null";
else
Button1.Text = Request.Cookies["message"].Value;
Regards,
Prakash Kalakoti
|
|
|
|
|
yes its working with Request.
thanks again
|
|
|
|
|
protected void btnAdd_Click(object sender, EventArgs e)
{
Response.Cookies["message"].Value = txtCookieValue.Text;
Response.Cookies["message"].Expires = DateTime.Now.AddDays(1);
btnAdd.Text = "done";
if (Response.Cookies["message"] != null)
Button1.Text = "null";
else
Button1.Text = Response.Cookies["message"].Value;
}
Button1.text = "null"
always.
can any one tell me why?
|
|
|
|
|
hotthoughtguy wrote: protected void btnAdd_Click(object sender, EventArgs e)
{
Response.Cookies["message"].Value = txtCookieValue.Text;
Response.Cookies["message"].Expires = DateTime.Now.AddDays(1);
btnAdd.Text = "done";
if (Response.Cookies["message"] != null)Button1.Text = "null";
else
Button1.Text = Response.Cookies["message"].Value;
}
It should be
protected void btnAdd_Click(object sender, EventArgs e)
{
Response.Cookies["message"].Value = txtCookieValue.Text;
Response.Cookies["message"].Expires = DateTime.Now.AddDays(1);
btnAdd.Text = "done";
if (Response.Cookies["message"] == null)
Button1.Text = "null";
else
Button1.Text = Response.Cookies["message"].Value;
}
Regards,
Prakash Kalakoti
|
|
|
|