Bumping this back up.
Users are getting annoyed that when they click one cell it is behaving like they clicked on 2.
Bumping this back up.
Users are getting annoyed that when they click one cell it is behaving like they clicked on 2.
We have added a Grid cell click event that will perform some actions, like adding the selected value to a text box. There are times when one cell is clicked, it seems to act like another cell is clicked at the same time, performing the same actions for the Not Clicked cell. Has anyone worked with an event that seems to trigger unexpectedly?
Below is the code.
private void grdserialtrans_ClickCell(object sender, Infragistics.Win.UltraWinGrid.ClickCellEventArgs args)
{
// ** Place Event Handling Code Here **
int rownum = args.Cell.Row.Index;
int cellnum = args.Cell.Column.Index;
EpiDataView porecv = (EpiDataView)this.oTrans.EpiDataViews["SNTransactions"];
string tempList = printList.Text;
string nextList = porecv.dataView[rownum][cellnum].ToString();
string tempList2 = printInvoices.Text;
bool callremoved= true;
if(cellnum == 7 && nextList != "0" && tempList.IndexOf(nextList)>-1 && printList.Text != "")
{
callremoved= false;
if(tempList.IndexOf(Environment.NewLine + nextList + Environment.NewLine)>-1 && printList.Text != "")
{
tempList= tempList.Replace(Environment.NewLine + nextList,"");
printList.Value= tempList;
}
if(tempList.IndexOf(Environment.NewLine + nextList)>-1 && printList.Text != "")
{
tempList= tempList.Replace(Environment.NewLine + nextList,"");
printList.Value= tempList;
}
else if(tempList.IndexOf(nextList + Environment.NewLine)>-1 && printList.Text != "")
{
tempList= tempList.Replace(nextList + Environment.NewLine,"");
printList.Value= tempList;
}
else if(tempList.IndexOf(nextList)>-1 && printList.Text != "")
{
tempList= tempList.Replace(nextList,"");
printList.Value= tempList;
}
else if(tempList == nextList)
{
printList.Value = "";
}
}
if(cellnum == 7 && nextList != "0" )
{
//Will not add invalid call number (0)
//Will not add call number already in the list
if(callremoved && tempList.IndexOf(nextList) == -1)
{
if(printList.Text == "")
{
printList.Value = nextList;
}
else
{
printList.Value = printList.Text + Environment.NewLine + nextList;
}
}
string jobnumber = "";
jobnumber = getJobnum(Convert.ToInt32(nextList));
string tempList3 = printJobs.Text;
if(tempList3.IndexOf(jobnumber)>-1 && !callremoved && tempList3 != "")
{
if(tempList.IndexOf(Environment.NewLine + jobnumber + Environment.NewLine)>-1 && tempList3 != "")
{
tempList3= tempList3.Replace(Environment.NewLine + jobnumber,"");
printJobs.Value= tempList3;
}
else if(tempList3.IndexOf(Environment.NewLine + jobnumber)>-1 && tempList3 != "")
{
tempList3= tempList3.Replace(Environment.NewLine + jobnumber,"");
printJobs.Value= tempList3;
}
if(tempList3.IndexOf(jobnumber + Environment.NewLine)>-1 && tempList3 != "")
{
tempList3= tempList3.Replace(jobnumber + Environment.NewLine,"");
printJobs.Value= tempList3;
}
else if(tempList3.IndexOf(jobnumber)>-1 && tempList3 != "")
{
tempList3= tempList3.Replace(jobnumber,"");
printJobs.Value= tempList3;
}
else if(tempList3 == jobnumber)
{
printJobs.Value = "";
}
}
if(jobnumber != "" && printJobs.Text == "" && callremoved && tempList.IndexOf(nextList) == -1)
{
printJobs.Value = jobnumber;
}
else if(jobnumber != "" && callremoved && tempList.IndexOf(nextList) == -1)
{
printJobs.Value = printJobs.Text + Environment.NewLine + jobnumber;
}
else
{
}
int invcnum = 0;
invcnum = getInvnum(Convert.ToInt32(nextList));
string invcnum2= "";
if(invcnum != 0)
{
invcnum2 = invcnum.ToString();
}
if(tempList2.IndexOf(invcnum2)>-1 && !callremoved && tempList2 != "")
{
tempList2= tempList2.Replace(Environment.NewLine + invcnum2,"");
printInvoices.Value= tempList2;
}
if(tempList2.IndexOf(Environment.NewLine + invcnum2)>-1 && tempList2 != "")
{
tempList2= tempList2.Replace(Environment.NewLine + invcnum2,"");
printInvoices.Value= tempList2;
}
else if(tempList2.IndexOf(invcnum2 + Environment.NewLine)>-1 && tempList2 != "")
{
tempList2= tempList2.Replace(invcnum2 + Environment.NewLine,"");
printInvoices.Value= tempList2;
}
else if(tempList3.IndexOf(invcnum2)>-1 && tempList2 != "")
{
tempList2= tempList3.Replace(invcnum2,"");
printInvoices.Value= tempList2;
}
else if(tempList2 == invcnum2 && tempList2 != "")
{
printInvoices.Value = "";
}
if(invcnum.ToString() != "0" && printInvoices.Text == "" && callremoved && tempList.IndexOf(nextList) == -1)
{
printInvoices.Value = invcnum.ToString();
}
else if(invcnum.ToString() != "0" && callremoved && tempList.IndexOf(nextList) == -1)
{
//comment so only one invoice allowed at a time
printInvoices.Value = printInvoices.Text + Environment.NewLine + invcnum;
//printInvoices.Value = invcnum.ToString();
}
else
{
}
}
else if(tempList.IndexOf(nextList) != -1)
{
//Call Number already is in the list
//Remove the call number from the list
}
else
{
}
porecv = null;
}