By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,456 Members | 1,742 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,456 IT Pros & Developers. It's quick & easy.

I NEED TO COLLECT FROM THE GRIDVIEW(DATASELECTED) IN TO A TABLE(SelectedPayment)

P: 14
I NEED TO COLLECT FROM THE GRIDVIEW(DATASELECTED) IN TO A TABLE(SelectedPayment)

--------------------------------------------------------------------------------

How TO COLLECT THE ROWS CHECKED IN CHECK BOX IN THE DATASELECTED TO ANOTHER GRID VIEW ON CLICLING BUTTON

I NEED TO COLLECT FROM THE GRIDVIEW(DATASELECTED) IN TO A TABLE(SelectedPayment)

SIMILLAR TO HOTMAIL MODEL.....CHECK THE MAILS AND BRING THE CHECKED DATA TO ANOTHER PAGE

Please help
Aug 30 '07 #1
Share this Question
Share on Google+
4 Replies


P: 14
How TO COLLECT THE ROWS CHECKED IN CHECK BOX IN THE DATASELECTED TO ANOTHER GRID VIEW ON CLICKING BUTTON(This happens the new gridview is displayed......but no selected data)

I NEED TO COLLECT FROM THE GRIDVIEW(DATASELECTED) IN TO A NEW TABLE SelectedPayments and display these on another grid view in same multi view

The Question is???
How do I Create Temp table to store data in Web User Interface.
I have one main page FinancePayment.aspx(basicaly a multiview, stats view, Detail View and Review data) all as DATAGRID VIEW
all this in One main view " Data View Listing".... on stats view i have all count of ID numbers....
on clicking on numbers i get all details as name last name etc.....for all the ID of persons this is on "Detail view page" THIS IS A DATAGRID with check box selection.......then i check the Record i want and click the process payment button......so the checked data from Dataview Listing has to come to the next view that is Review data......Here i need help to get the data..how can i get the data when i have no connection with server ...and i only want to checked data on the Review data page where i finally approve and records gets inserted to database

I am having datagrids to collect data for the first page and in C# coding I have given query and now I get these data on first page.

I need help to get the selected data on Detail View to appear on the next page Review Data.

This is code i am using to get data for first page...and i HAVE THE ROWS THAT I CHECK...

// Not_Paid_BTM

protected void Cick_Detail_Enrollment(object sender, EventArgs e)
{
//EnrollNotPaidBTM
WebLibraryClass ConnectionFinanceDB;
ConnectionFinanceDB = new WebLibraryClass();
Button ObjectClick = (Button)sender;
string ConditionValue;
SessionValues ValueSelected = null;

ProcPaymBTM.Visible = true;
if (Session[Session_UserSPersonalData] == null)
{
ValueSelected = new SessionValues();
Session.Add(Session_UserSPersonalData, ValueSelected);
}
else
{
ValueSelected = (SessionValues)(Session[Session_UserSPersonalData]);
}

ConditionValue = ValueSelected.CONDITION;
ValueSelected.PaymentSelected = ObjectClick.ID.ToString();


if (ObjectClick.ID.ToString() == "EnrollNotPaidBTM")
{


DbDataReader CollectingDataSelected = null;
Dataviewlisting.ActiveViewIndex += 1;
try
{
CollectingDataSelected = ConnectionFinanceDB.CollectedFinaceData("SELECT DISTINCT ID, [FIRST NAME],[LAST NAME],Project_ID as [PROJECT ID],[PROJ START DT]AS ENROLLMENT,[PROJ END DT] AS TERMINATION,TERM AS [TERM CODE] FROM dbo.V_1st_Enrollment_Agency_Payment_List " + ConditionValue);
}
catch
{

}
DataTable TableSet = new DataTable();
TableSet.Load(CollectingDataSelected, LoadOption.OverwriteChanges);
DetailDataList.DataSource = TableSet.DefaultView;
DetailDataList.DataBind();
}
}

This is where the Button function is...THAT SHOULD BRING THE SELECTED DATA ROWS AND COLUMNS FROM EARLIER GRID VIEW TO NEXT GRID VIEW WHAT EVER SELECTED ON THAT PAGE

protected void ProcPaymBTM_Click(object sender, EventArgs e)

{

Dataviewlisting.ActiveViewIndex += 1;

int IndexCount = 0;

String ProcessingPayment;

SessionValues ValueSelected = null;

DataTable SelectedPayment = new DataTable();



if (Session[Session_UserSPersonalData] == null)

{

ValueSelected = new SessionValues();

Session.Add(Session_UserSPersonalData, ValueSelected);

}

else

{

ValueSelected = (SessionValues)(Session[Session_UserSPersonalData]);

}



ProcessingPayment = ValueSelected.PaymentSelected;

switch (ProcessingPayment)

{

case "EnollNotPaidBTM":

break;

case "PlacNotPaidBTM":

break;

case "Ret1NotPaidBTM":

break;

case "Ret3NotPaidBTM":

break;

case "Ret6NotPaidBTM":

break;

case "Place2ndNotPaidBTM":

break;

case "EnrollBonusNotPaidBTM":

break;

case "WPRNotPaidBTM":

break;

case "SatisCompleteNotPaidBTM":

break;

default:

break;

}

foreach (GridViewRow DataSelected in this.DetailDataList.Rows)

{

if (((CheckBox)DataSelected.FindControl("ApprovalCk") ).Checked)

{

IndexCount += 1;

// DataTable SelectedPayment = new DataTable();

// HERE I NEED HAVE TO COLLECT THE ROWS CHECK IN THE DATASELECTED

// HOW TO COLLECT FROM THE GRIDVIEW(DATASELECTED) IN TO A TABLE(SelectedPayment)


}

}

Titlelb.Text = "Number Check is " + IndexCount.ToString() + " payment Selected " + ProcessingPayment;

}





Please suggest...OR ANYBODY KNOW BETTER HOW TO MAKE THIS WORK...AWAITING REPLY......

Thanks

Santosh George
Aug 31 '07 #2

kenobewan
Expert 2.5K+
P: 4,871
Suggest you do not overuse allcaps, its like shouting. My next suggestion is to search the site for other related threads. A datatable may met your temporary storage needs.
Aug 31 '07 #3

kenobewan
Expert 2.5K+
P: 4,871
Please stop posting multiple times. Thanks.

MODERATOR
Aug 31 '07 #4

P: 14
This is what i did ....adding a creating a table.......and getting the cols and rows from previoud grid view.....but it does not work.....
protected void ProcPaymBTM_Click(object sender, EventArgs e)
{
Dataviewlisting.ActiveViewIndex += 1;
int IndexCount = 0;
int colindex, rowindex;
String ProcessingPayment;
SessionValues ValueSelected = null;
DataTable SelectedPayment = new DataTable("SelectedPayment");

if (Session[Session_UserSPersonalData] == null)
{
ValueSelected = new SessionValues();
Session.Add(Session_UserSPersonalData, ValueSelected);
}
else
{
ValueSelected = (SessionValues)(Session[Session_UserSPersonalData]);
}

ProcessingPayment = ValueSelected.PaymentSelected;
switch (ProcessingPayment)
{
case "EnollNotPaidBTM":
break;
case "PlacNotPaidBTM":
break;
case "Ret1NotPaidBTM":
break;
case "Ret3NotPaidBTM":
break;
case "Ret6NotPaidBTM":
break;
case "Place2ndNotPaidBTM":
break;
case "EnrollBonusNotPaidBTM":
break;
case "WPRNotPaidBTM":
break;
case "SatisCompleteNotPaidBTM":
break;
default:
break;
}
foreach (GridViewRow DataSelected in this.DetailDataList.Rows)
{
if (((CheckBox)DataSelected.FindControl("ApprovalCk") ).Checked)
{
IndexCount += 1;
{
if (this.DetailDataList.DataSelected.IndexCount > 0)
{
DataTable SelectedPayment = new DataTable("SelectedPayment");
int columns = DetailDataList.ColumnCount;
int i = 0;
for (i = 0; i < columns; i++)
{
SelectedPayment.Columns.Add(DetailDataList.Columns[i].Name.ToString());
}

DataRow dr = null;

foreach (DataGridViewCell cell in DetailDataList.SelectedCells)
{
colindex = cell.ColumnIndex;
rowindex = cell.RowIndex;
textBox1.Text = this.DetailDataList.Rows[rowindex].Cells[colindex].Value.ToString();

if (colindex == 0)
{
dr = SelectedPayment.NewRow();
}

dr[colindex] = textBox1.Text;

if (colindex == (columns - 1))
{
SelectedPayment.Rows.Add(dr);
SelectedPayment.AcceptChanges();
}
}
DataTable ds = new DataTable("table");
ds.Tables.Add(SelectedPayment);
sendParameters(SelectedPayment, 1);
ReviewSelectionGD.DataSource = ds.DefaultView;
ReviewSelectionGD.DataBind();

}
}
}
Titlelb.Text = "Number Check is " + IndexCount.ToString() + " payment Selected " + ProcessingPayment;
}
}
Aug 31 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.