|
I want to have DataGridView that show nested data. it maybe have a column like treeview object.
It is on Windows form application.
any idea for it?Mahdi 82161021
|
|
|
|
|
Here is a complete list[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
As the title says System.IO.Ports.SerialPort.Open() is catching TimeoutException popping a MessageBox and continuing to try to connect until I call close. I would prefer to catch the exception myself. Is there a setting somewhere in my VS8 that controls this? I don't see anything in the docs that mention it.
TIA,
Greg.
|
|
|
|
|
greg_martin wrote: System.IO.Ports.SerialPort.Open() is catching TimeoutException popping a MessageBox
Are you sure that is not in your code? According to the documentation[^] the Open() method neither throws nor catches TimeoutException .txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Your right. Mea culpa. I was expecting open to fail but it isn't it's the first read that is failing. Thanks.
|
|
|
|
|
greg_martin wrote: popping a MessageBox
Ummm... what?
|
|
|
|
|
the port has a letter box.
|
|
|
|
|
Another member when using code in one of my articles came across a peculiarity that I'm trying to resolve.
It seems that whenever the DataSource of a DataGridView is changed, if the mouse is over the Control, a WM_MOUSEMOVE (0x0200) message is generated
Is there any reason why this would be the case, and any idea of a workaround as the component does something on that message so this situation is causing undesired and unexpected behaviour!?
[Edit] The only quick workaround I can think of is to store and check against the previous lParam of this message to see if the mouse has actually moved - yuk! [/Edit]
[Edit2] The workaround using lParam is here[^] if anyone else comes across this. [/Edit2]
Dave
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
modified on Sunday, March 21, 2010 9:45 PM
|
|
|
|
|
Hi Guys!
I am in a bit of a Dilemma here and need some help. I have a table that has a row and three columns which are showed to the user after the page loads. There is a button which calls a code behind function to add a new row. The first time the user clicks, the row is added properly, no problem. The second time however, the row is not added but the previous row that was added is updated with the new id/name etc. Also the second time, the drop down menu gives an error which is quiet ridiculous, something to do with accessing innerHtml of the drop down menu when I am not even asking the compiler to assign anything of that sort. Please have a look and let me know where the problem is which my brain cells are failing to recognise.
Note: I have tried all the different methods to add the row for example table.Rows.Insert(index,htmlRow) etc.
Thanks is Advance.
Below id my code for reference:
=============================
Front End [HTML - Table only]
=============================
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table cellpadding="3" cellspacing="3" runat="server">
<tr>
<td style="font-family:Courier New; font-size:12pt;"><b>Loan Type</b></td>
<td style="font-family:Courier New; font-size:12pt;"><b>Amount Owing</b></td>
<td style="font-family:Courier New; font-size:12pt;"><b>Monthly Repayments</b></td>
</tr>
</table>
<table cellpadding="3" cellspacing="3" id="tblLoanTypes" runat="server">
<tr>
<td width="33%">
<select name="loanType1" id="loanType1" class="txtNormalDrp" runat="server">
<option value="" selected="selected">Please Select</option>
<option value="Home Loan">Home Loan</option>
<option value="Investment Loan">Investment Loan</option>
<option value="Credit Card">Credit Card</option>
<option value="Personal Loan">Personal Loan</option>
<option value="Store Cards">Store Cards</option>
<option value="Tax Debt">Tax Debt</option>
<option value="Other">Other</option>
</select>
</td>
<td width="33%"><input type="text" class="txtBalrepayments" name="balance1" id="balance1" onfocusout="fcnAddTotals();" onkeypress="return numbersonly(event, false)" /></td>
<td><input type="text" class="txtBalrepayments" name="mRepayments1" id="mRepayments1" onfocusout="fcnAddPayments();" onkeypress="return numbersonly(event, false)" /></td>
</tr>
</table>
<table>
<tr>
<td><asp:ImageButton ID="iBtnAddRow" runat="server"
ImageUrl="images/btnAddRows.jpg" onclick="iBtnAddRow_Click" /> <asp:ImageButton
ID="iBtnRemoveRow" runat="server" ImageUrl="images/btnRemoveRows.jpg"
onclick="iBtnRemoveRow_Click" />
</td>
</tr>
</table>
</asp:Content>
======================
Code Behind [.cs File]
======================
protected void iBtnAddRow_Click(object sender, ImageClickEventArgs e)
{
int iIndex = Convert.ToInt32(Session["iKeyIndex"]);
iIndex = iIndex+1;
//Instantiate and create new items
HtmlTableRow rTableRow = new HtmlTableRow();
HtmlTableCell cTableCellLoanTypeDropDown = new HtmlTableCell();
HtmlTableCell cTableCellBalance = new HtmlTableCell();
HtmlTableCell cTableCellMonthlyRepayments = new HtmlTableCell();
HtmlSelect hSelect = new HtmlSelect();
TextBox txtBalance = new TextBox();
TextBox txtRepayments = new TextBox();
try
{
///******************** First we create the drop down menu *******************************///
hSelect.Attributes.Add("name", "loanType" + iIndex);
hSelect.Attributes.Add("id", "loanType" + iIndex);
hSelect.Attributes.Add("class", "txtNormalDrp");
hSelect.Attributes.Add("runat", "server");
//Add the selection items to hSelect
ListItem lst = new ListItem("Please Select", "");
lst.Attributes.Add("Selected", "Selected");
hSelect.Items.Add(lst);
ListItem lst1 = new ListItem("Home Loan", "Home Loan");
hSelect.Items.Add(lst1);
ListItem lst2 = new ListItem("Investment Loan", "Investment Loan");
hSelect.Items.Add(lst2);
ListItem lst3 = new ListItem("Credit Card", "Credit Card");
hSelect.Items.Add(lst3);
ListItem lst4 = new ListItem("Personal Loan", "Personal Loan");
hSelect.Items.Add(lst4);
ListItem lst5 = new ListItem("Store Cards", "Store Cards");
hSelect.Items.Add(lst5);
ListItem lst6 = new ListItem("Tax Debt", "Tax Debt");
hSelect.Items.Add(lst6);
ListItem lst7 = new ListItem("Other", "Other");
hSelect.Items.Add(lst7);
//Assign the drop down to the first cell
//cTableCellLoanTypeDropDown.Controls.Add(hSelect);
///**************************************************************************************///
///*************** Second we create the Text box for Balance*****************************///
txtBalance.Attributes.Add("class", "txtBalrepayments");
txtBalance.Attributes.Add("name", "balance" + iIndex);
txtBalance.Attributes.Add("id", "balance" + iIndex);
txtBalance.Attributes.Add("onfocusout", "fcnAddTotals();");
txtBalance.Attributes.Add("onkeypress", "return numbersonly(event, false)");
//Assign the textbox to the second column
cTableCellBalance.Controls.Add(txtBalance);
///**************************************************************************************///
///*************** Second we create the Text box for Monthly Repayments******************///
txtRepayments.Attributes.Add("class", "txtBalrepayments");
txtRepayments.Attributes.Add("name", "mRepayments" + iIndex);
txtRepayments.Attributes.Add("id", "mRepayments" + iIndex);
txtRepayments.Attributes.Add("onfocusout", "fcnAddTotals();");
txtRepayments.Attributes.Add("onkeypress", "return numbersonly(event, false)");
//Assign the textbox to the third column
cTableCellMonthlyRepayments.Controls.Add(txtRepayments);
///**************************************************************************************///
///************************************ FINALLY *****************************************///
//Add the Row to the table
//tblLoanTypes.Rows.Insert((tblLoanTypes.Rows.Count+1), rTableRow);
tblLoanTypes.Rows.Add(rTableRow);
//Add the cells and rows to the table: tblLoanTypes
rTableRow.Cells.Add(cTableCellLoanTypeDropDown);
rTableRow.Cells.Add(cTableCellBalance);
rTableRow.Cells.Add(cTableCellMonthlyRepayments);
//Increase the index and save it to the session variable
Session["iKeyIndex"] = iIndex;
}
catch (Exception sError)
{
//Functions._sendEmail(Error generating Rows", System.Configuration.ConfigurationManager.AppSettings["sWebAdminEmail"].ToString(),
// "An error has occured generating Dynamic Rows on Error: " + sError.Message);
}
finally
{
//Flush all the declarations
hSelect.Dispose();
txtBalance.Dispose();
txtRepayments.Dispose();
cTableCellLoanTypeDropDown.Dispose();
cTableCellBalance.Dispose();
cTableCellMonthlyRepayments.Dispose();
rTableRow.Dispose();
}
}
P.S: Sorry but my previous post caused some issue to the forum. I appologise for any inconvenience caused.
Thanksmodified on Wednesday, March 17, 2010 3:16 PM
|
|
|
|
|
Go back and edit your post. There's some tag in it that's screwing up the formatting of the entire forum!
|
|
|
|
|
Hi Dave!
Please let me know if this edit solved the problem, else I can delete the post. Sorry for any inconvenience caused
Regards,
Ali
|
|
|
|
|
You have broken Forum, if you can edid, edid part that uses <>. I recomend when you pasting use option: "Encode "<" (and other HTML) characters when pasting".
For the actual code, please use PRE tags, so that is more readable
|
|
|
|
|
Please contact the hamsters (via the site bugs and suggestions forum) to let them know what you did to break the forum: I am sure they will want to make sure it can't happen again! You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
This page cam be easly costumized with HTML tags. tag like </td> can realy break forum
|
|
|
|
|
Should it be the PostBack of iBtnAddRow that generates all the code again! Try saving the table in a Session or a ViewState! and after every postback return it back!
like
protected void iBtnAddRow_Click(object sender, ImageClickEventArgs e)
{
Session["YourTable"] = tblLoanTypes;
}
private void Page_Load(
{
tbl_LoanTypes = (HtmlTable)Session["YourTable"];
}
|
|
|
|
|
Thanks for the reply mate! I'll give it a try and see how it goes though I am sure that it might not be a good idea saving the table in the session as this is a high traffic site and people can have more than 10 rows in their table. So the table times the number of users may make the site perform slow. Nonetheless, I will carry out an SVT and see how it goes.
Regards.
|
|
|
|
|
I am looking for a way to open a eml file and save it to an image format like a multi page tif. Also I need a way to check if it has an attachment and then save its attachment also.
|
|
|
|
|
I have a customized ComboBox and a class with many properties. I am putting one of my ComboBoxes on my MainForm for each property in my class. When it’s time to “run” my application I need to transfer a value from each ComboBox into a different property in my class.
Ex: I have 5 MyCB : ComboBox and MyClass with 5 properties. When I start my processing I need to take a value from each ComboBox and put it into a different Property.
MyClass.PropA = MyCBa.MyValue;
MyClass.PropB = MyCBb.MyValue;
MyClass.PropC = MyCBc.MyValue;
…ect…
This doesn’t “feel” like the best way to do this. I came to this feeling when I needed to do a similar process for 20 items and was just cutting and pasting code and changing a letter.
My question is: Is there a more OO way of doing this, or a “best practice” method/pattern for this type of mapping? I would love to hear all ideas and suggestions.
Thank you all for your time!
|
|
|
|
|
You could create a global static binder class that contains both set of properties (the ones for class A, and the ones for class B). In the Setter method for both sets of properties, just set the other set of properties with the specified value. Then, when you Get the property (no matter which version), you'll always get the same value for the given property.
I think that would be one way...
Of course, you could just derive class b from class a (a from b, whichever is applicable) and then you'd get to use all those properties without having to do anything special..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Of course this is not the "preferred" MS way because it does not use data binding. Also, it does violate the principle of Data Hiding so it isn't the best OO method either but it is easy.
public class MySpecialLittleComboBox : ComboBox{
private MyClass MyClass{
get;
set;
}
protected override void OnSelectedIndexChanged(EventArgs e) {
base.OnSelectedIndexChanged(e);
MyClass.SomeProperty = (Items)SelectedItem;
}
public MySpecialLittleComboBox(List<Item> items, MyClass myClass){
Items.Clear();
foreach (Item item in items) {
Items.Add(item);
}
MyClass = myClass;
if(Items.Count > 0)
SelectedIndex = 0;
}
}
|
|
|
|
|
Hello,
i am using visual C# express 2008. I SOMETIMES get the illegal cross thread operation in my invoke method when i try to run my project. I check the InvokeRequired property, invoke the same method and in the 'else' condition i create atemporary variable and assign it the text of my control. But on that line, in the 'else' statement, inside the Invoking method i sometimes get the exception. What could be the cause? How to get rid of it? It does not occur often, but it is still a bug...
TY
|
|
|
|
|
Try using BeginInvoke on your control instead.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
FYI, that would prevent a locking situation, but would not likely prevent a cross-thread exception. It would also change the flow of the program (i.e., the call would be asynchronous rather than blocking), which the OP may not want.
|
|
|
|
|
I agree.
|
|
|
|
|
Without seeing your code, it's pretty much impossible to tell you where it's going wrong.
|
|
|
|