Click here to Skip to main content
15,881,757 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow can I properly use the Trace.Write() method inside of my for loop to print month and future values? Pin
Dorakta21-Sep-17 12:36
Dorakta21-Sep-17 12:36 
AnswerRe: How can I properly use the Trace.Write() method inside of my for loop to print month and future values? Pin
Richard Deeming22-Sep-17 2:11
mveRichard Deeming22-Sep-17 2:11 
QuestionSystem.ServiceModel.FaultException`1 occurred Pin
jkirkerx21-Sep-17 12:05
professionaljkirkerx21-Sep-17 12:05 
AnswerRe: System.ServiceModel.FaultException`1 occurred Pin
jkirkerx22-Sep-17 6:29
professionaljkirkerx22-Sep-17 6:29 
AnswerUPS Rate SOAP WSDL Errors in VS2017 Service Reference, An exception has been raised as a result of client data. Pin
jkirkerx22-Sep-17 11:07
professionaljkirkerx22-Sep-17 11:07 
QuestionRepeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex20-Sep-17 4:38
samflex20-Sep-17 4:38 
AnswerRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming20-Sep-17 10:15
mveRichard Deeming20-Sep-17 10:15 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex21-Sep-17 3:50
samflex21-Sep-17 3:50 
Hi Richard,
Sorry I could not respond last night because I didn't have access to my laptop from where I was.

SetInitialRow() is called in page_load() event:

if (!Page.IsPostBack)
   {
       this.SetInitialRow();
       ...
       ...
   }
 }

SetInitialRow2() is called in populateRecord function:
      private void PopulateRecord()
         {
             foreach (RepeaterItem item in Repeater1.Items)
             {
                 string registerNumber = (item.FindControl("txtboatregNum") as TextBox).Text;
                 string bregisterNumber = (item.FindControl("cgaurdNumber") as TextBox).Text;

                 if (item.ItemIndex == 0)
                 {
                     this.SetInitialRow2(registerNumber, bregisterNumber);
                 }

                 else
                 {
                     AddNewRow2(registerNumber, bregisterNumber);
                 }
                 foreach (RepeaterItem Item in Repeater2.Items)
                 {
                     (Item.FindControl("BtnAdd2") as Button).Visible = Repeater2.Items.Count > 2;
                     (Item.FindControl("btnDelete2") as Button).Visible = Repeater2.Items.Count > 2;
                 }
             }
   }<pre>
   which in turn is called by the NEXT button click event:

<pre>protected void OnClickNext(object sender, EventArgs e)
       {

           int rowIndex = 0;
           if (ViewState["CurrTable"] != null)
           {
               DataTable dtCurrentTable = (DataTable)ViewState["CurrTable"];
               if (dtCurrentTable.Rows.Count > 0)
               {

                   for (int i = 1; i <= Repeater1.Items.Count; i++)
                   {
                       TextBox tbboatregNum = (TextBox)Repeater1.Items[rowIndex].FindControl("txtboatregNum");
                       TextBox tbPayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("txtPayerret");
                       TextBox tbCGvesselNum = (TextBox)Repeater1.Items[rowIndex].FindControl("cgaurdNumber");
                       TextBox tbCGtaxpayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("cguardreturnedval");
                       dtCurrentTable.Rows[i - 1]["MarineRegNo"] = tbboatregNum.Text;
                       dtCurrentTable.Rows[i - 1]["TaxPyrRetdVal"] = tbPayerret.Text;
                       dtCurrentTable.Rows[i - 1]["VesselRegNo"] = tbCGvesselNum.Text;
                       dtCurrentTable.Rows[i - 1]["VesselTaxPyrRetdVal"] = tbCGtaxpayerret.Text;
                       rowIndex++;
                   }
                   ViewState["TempData"] = dtCurrentTable;
               }
               myMultiView.ActiveViewIndex += 1;
               if (myMultiView.ActiveViewIndex != 3)
               {
                   PopulateRecord();
               }
           }
   }

So, clicking next is supposed to pass these values from Repeater1 to Repeater2.

There are also some other dependencies like getting the total value of TaxPyrRetdVal and VesselTaxPyrRetdVal but they are not relevant because once Repeater is able
to recognize MarineRegNo and VesselRegNo, the others become visible.

Then there are a couple of stored procedures that populate both SetInitialRow() and SetInitialRow2() datatables.

If you remove SetInitialRow2(), then there is no issues with passing the values from Repeater1 to Repeater2.
Only issue there is that the values for Repeater2 will not be passed, only those two form values, MarineRegNo and VesselRegNo are passed.

I must admit that I didn't do all of these by myself.

It is really very long and complicated code.

If I can figure out a way to check the dt datable table values before binding to Repeater, perhaps this could work.

Also, if I remove the stored procedures, everything will be populated on both repeaters except the two most important iems MarineRegNo and VesselRegNo.

I have been stuck on this now for days and was supposed to be demo'ing this app this morning.

Thanks sir as usual for all your expert assistance.
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming21-Sep-17 5:12
mveRichard Deeming21-Sep-17 5:12 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex21-Sep-17 6:33
samflex21-Sep-17 6:33 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming21-Sep-17 6:39
mveRichard Deeming21-Sep-17 6:39 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex21-Sep-17 7:26
samflex21-Sep-17 7:26 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming21-Sep-17 7:32
mveRichard Deeming21-Sep-17 7:32 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex21-Sep-17 8:32
samflex21-Sep-17 8:32 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming21-Sep-17 8:55
mveRichard Deeming21-Sep-17 8:55 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex21-Sep-17 9:39
samflex21-Sep-17 9:39 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming21-Sep-17 9:47
mveRichard Deeming21-Sep-17 9:47 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex21-Sep-17 10:03
samflex21-Sep-17 10:03 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming22-Sep-17 1:52
mveRichard Deeming22-Sep-17 1:52 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex22-Sep-17 3:29
samflex22-Sep-17 3:29 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming22-Sep-17 3:35
mveRichard Deeming22-Sep-17 3:35 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex22-Sep-17 3:49
samflex22-Sep-17 3:49 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming22-Sep-17 4:39
mveRichard Deeming22-Sep-17 4:39 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex22-Sep-17 4:56
samflex22-Sep-17 4:56 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex22-Sep-17 5:09
samflex22-Sep-17 5:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.