Search Results

Search found 9542 results on 382 pages for 'row'.

Page 1/382 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • FAQ: Highlight GridView Row on Click and Retain Selected Row on Postback

    - by Vincent Maverick Durano
    A couple of months ago I’ve written a simple demo about “Highlighting GridView Row on MouseOver”. I’ve noticed many members in the forums (http://forums.asp.net) are asking how to highlight row in GridView and retain the selected row across postbacks. So I’ve decided to write this post to demonstrate how to implement it as reference to others who might need it. In this demo I going to use a combination of plain JavaScript and jQuery to do the client-side manipulation. I presumed that you already know how to bind the grid with data because I will not include the codes for populating the GridView here. For binding the gridview you can refer this post: Binding GridView with Data the ADO.Net way or this one: GridView Custom Paging with LINQ. To get started let’s implement the highlighting of GridView row on row click and retain the selected row on postback.  For simplicity I set up the page like this: <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>You have selected Row: (<asp:Label ID="Label1" runat="server" />)</h2> <asp:HiddenField ID="hfCurrentRowIndex" runat="server"></asp:HiddenField> <asp:HiddenField ID="hfParentContainer" runat="server"></asp:HiddenField> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Trigger Postback" /> <asp:GridView ID="grdCustomer" runat="server" AutoGenerateColumns="false" onrowdatabound="grdCustomer_RowDataBound"> <Columns> <asp:BoundField DataField="Company" HeaderText="Company" /> <asp:BoundField DataField="Name" HeaderText="Name" /> <asp:BoundField DataField="Title" HeaderText="Title" /> <asp:BoundField DataField="Address" HeaderText="Address" /> </Columns> </asp:GridView> </asp:Content>   Note: Since the action is done at the client-side, when we do a postback like (clicking on a button) the page will be re-created and you will lose the highlighted row. This is normal because the the server doesn't know anything about the client/browser not unless if you do something to notify the server that something has changed. To persist the settings we will use some HiddenFields control to store the data so that when it postback we can reference the value from there. Now here’s the JavaScript functions below: <asp:content id="Content1" runat="server" contentplaceholderid="HeadContent"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script> <script type="text/javascript">       var prevRowIndex;       function ChangeRowColor(row, rowIndex) {           var parent = document.getElementById(row);           var currentRowIndex = parseInt(rowIndex) + 1;                 if (prevRowIndex == currentRowIndex) {               return;           }           else if (prevRowIndex != null) {               parent.rows[prevRowIndex].style.backgroundColor = "#FFFFFF";           }                 parent.rows[currentRowIndex].style.backgroundColor = "#FFFFD6";                 prevRowIndex = currentRowIndex;                 $('#<%= Label1.ClientID %>').text(currentRowIndex);                 $('#<%= hfParentContainer.ClientID %>').val(row);           $('#<%= hfCurrentRowIndex.ClientID %>').val(rowIndex);       }             $(function () {           RetainSelectedRow();       });             function RetainSelectedRow() {           var parent = $('#<%= hfParentContainer.ClientID %>').val();           var currentIndex = $('#<%= hfCurrentRowIndex.ClientID %>').val();           if (parent != null) {               ChangeRowColor(parent, currentIndex);           }       }          </script> </asp:content>   The ChangeRowColor() is the function that sets the background color of the selected row. It is also where we set the previous row and rowIndex values in HiddenFields.  The $(function(){}); is a short-hand for the jQuery document.ready event. This event will be fired once the page is posted back to the server that’s why we call the function RetainSelectedRow(). The RetainSelectedRow() function is where we referenced the current selected values stored from the HiddenFields and pass these values to the ChangeRowColor() function to retain the highlighted row. Finally, here’s the code behind part: protected void grdCustomer_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onclick", string.Format("ChangeRowColor('{0}','{1}');", e.Row.ClientID, e.Row.RowIndex)); } } The code above is responsible for attaching the javascript onclick event for each row and call the ChangeRowColor() function and passing the e.Row.ClientID and e.Row.RowIndex to the function. Here’s the sample output below:   That’s it! I hope someone find this post useful! Technorati Tags: jQuery,GridView,JavaScript,TipTricks

    Read the article

  • FAQ&ndash;Highlight GridView Row on Click and Retain Selected Row on Postback

    - by Vincent Maverick Durano
    A couple of months ago I’ve written a simple demo about “Highlighting GridView Row on MouseOver”. I’ve noticed many members in the forums (http://forums.asp.net) are asking how to highlight row in GridView and retain the selected row across postbacks. So I’ve decided to write this post to demonstrate how to implement it as reference to others who might need it. In this demo I going to use a combination of plain JavaScript and jQuery to do the client-side manipulation. I presumed that you already know how to bind the grid with data because I will not include the codes for populating the GridView here. For binding the gridview you can refer this post: Binding GridView with Data the ADO.Net way or this one: GridView Custom Paging with LINQ. To get started let’s implement the highlighting of GridView row on row click and retain the selected row on postback.  For simplicity I set up the page like this: <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>You have selected Row: (<asp:Label ID="Label1" runat="server" />)</h2> <asp:HiddenField ID="hfCurrentRowIndex" runat="server"></asp:HiddenField> <asp:HiddenField ID="hfParentContainer" runat="server"></asp:HiddenField> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Trigger Postback" /> <asp:GridView ID="grdCustomer" runat="server" AutoGenerateColumns="false" onrowdatabound="grdCustomer_RowDataBound"> <Columns> <asp:BoundField DataField="Company" HeaderText="Company" /> <asp:BoundField DataField="Name" HeaderText="Name" /> <asp:BoundField DataField="Title" HeaderText="Title" /> <asp:BoundField DataField="Address" HeaderText="Address" /> </Columns> </asp:GridView> </asp:Content>   Note: Since the action is done at the client-side, when we do a postback like (clicking on a button) the page will be re-created and you will lose the highlighted row. This is normal because the the server doesn't know anything about the client/browser not unless if you do something to notify the server that something has changed. To persist the settings we will use some HiddenFields control to store the data so that when it postback we can reference the value from there. Now here’s the JavaScript functions below: <asp:content id="Content1" runat="server" contentplaceholderid="HeadContent"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script> <script type="text/javascript">       var prevRowIndex;       function ChangeRowColor(row, rowIndex) {           var parent = document.getElementById(row);           var currentRowIndex = parseInt(rowIndex) + 1;                 if (prevRowIndex == currentRowIndex) {               return;           }           else if (prevRowIndex != null) {               parent.rows[prevRowIndex].style.backgroundColor = "#FFFFFF";           }                 parent.rows[currentRowIndex].style.backgroundColor = "#FFFFD6";                 prevRowIndex = currentRowIndex;                 $('#<%= Label1.ClientID %>').text(currentRowIndex);                 $('#<%= hfParentContainer.ClientID %>').val(row);           $('#<%= hfCurrentRowIndex.ClientID %>').val(rowIndex);       }             $(function () {           RetainSelectedRow();       });             function RetainSelectedRow() {           var parent = $('#<%= hfParentContainer.ClientID %>').val();           var currentIndex = $('#<%= hfCurrentRowIndex.ClientID %>').val();           if (parent != null) {               ChangeRowColor(parent, currentIndex);           }       }          </script> </asp:content>   The ChangeRowColor() is the function that sets the background color of the selected row. It is also where we set the previous row and rowIndex values in HiddenFields.  The $(function(){}); is a short-hand for the jQuery document.ready function. This function will be fired once the page is posted back to the server that’s why we call the function RetainSelectedRow(). The RetainSelectedRow() function is where we referenced the current selected values stored from the HiddenFields and pass these values to the ChangeRowColor) function to retain the highlighted row. Finally, here’s the code behind part: protected void grdCustomer_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onclick", string.Format("ChangeRowColor('{0}','{1}');", e.Row.ClientID, e.Row.RowIndex)); } } The code above is responsible for attaching the javascript onclick event for each row and call the ChangeRowColor() function and passing the e.Row.ClientID and e.Row.RowIndex to the function. Here’s the sample output below:   That’s it! I hope someone find this post useful! Technorati Tags: jQuery,GridView,JavaScript,TipTricks

    Read the article

  • UITableView - Select nearest row after row deletion.

    - by sunnycmf
    like build in apple notes app, after you swipe to delete the selected row, it will select the nearest available row automatically. The logic should be: if row count 0 then if deleted_row == last row then select deleted_row_index-1 row else select deleted_row_index+1 row end end i have try to implement the above logic in the commitEditingStyle event, but the selection fail. the selectRowAtIndexPath logic just don't work in this event, if i apply it in a button, it works. any idea?

    Read the article

  • Count a row VS Save the Row count after each update

    - by SAFAD
    I want to know whether saving row count in a table is better than counting it each time of the proccess. Quick Example : A visitor goes to Group Clan, the page displays clan information and Members who have joined the group,Should the page look for all the users who joined the clan and count them, or just display the number of members already saved in table ? I think the first one is not possible to get manipulated with but IT MIGHT cost performance Your Ideas ?

    Read the article

  • php foreach question

    - by user295189
    I have the following code $oldID=-1; $column=0; foreach($pv->rawData as $data){ if ($oldID!= $data->relativeTypeID){ $oldID= $data->relativeTypeID; $column++; $row=1; } echo "Row: ".$row.": Column: ".$column.": ID".$data->relativeTypeID."<br>"; //if exists a description if($data->description){ //insert here in the array $pv->results[$data->relativeTypeID][$row][0]= $data->relation; $pv->results[$data->relativeTypeID][$row][1]= ''; $pv->results[$data->relativeTypeID][$row][2] =''; $pv->results[$data->relativeTypeID][$row][3] = ''; $row++; } } this generates this output Row: 1: Column: 1: ID1 Row: 2: Column: 1: ID1 Row: 1: Column: 2: ID2 Row: 2: Column: 2: ID2 Row: 3: Column: 2: ID2 Row: 4: Column: 2: ID2 Row: 5: Column: 2: ID2 Row: 6: Column: 2: ID2 Row: 7: Column: 2: ID2 Row: 8: Column: 2: ID2 Row: 9: Column: 2: ID2 Row: 10: Column: 2: ID2 Row: 11: Column: 2: ID2 Row: 1: Column: 3: ID3 Row: 1: Column: 4: ID4 Row: 1: Column: 5: ID8 Row: 2: Column: 5: ID8 Row: 3: Column: 5: ID8 Row: 1: Column: 6: ID10 Row: 2: Column: 6: ID10 Row: 3: Column: 6: ID10 Row: 4: Column: 6: ID10 ... .. what I want it to do is to stop at the top 4 columns so I want an output like this Row: 1: Column: 1: ID1 Row: 2: Column: 1: ID1 Row: 1: Column: 2: ID2 Row: 2: Column: 2: ID2 Row: 3: Column: 2: ID2 Row: 4: Column: 2: ID2 Row: 5: Column: 2: ID2 Row: 6: Column: 2: ID2 Row: 7: Column: 2: ID2 Row: 8: Column: 2: ID2 Row: 9: Column: 2: ID2 Row: 10: Column: 2: ID2 Row: 11: Column: 2: ID2 Row: 1: Column: 3: ID3 Row: 1: Column: 4: ID4 as you can see it stopped at column 4. Thanks

    Read the article

  • how to display the below xml in the flex datagrid

    - by Kishore
    <rows> - <row rowno="1"> - <row-value> <colno>1</colno> <value>1</value> </row-value> - <row-value> <colno>2</colno> <value>sel</value> </row-value> - <row-value> <colno>3</colno> <value>select * from qt_query</value> </row-value> - <row-value> <colno>4</colno> <value>kishore</value> </row-value> - <row-value> <colno>5</colno> <value>2009-04-10 00:00:00.0</value> </row-value> - <row-value> <colno>6</colno> </row-value> - <row-value> <colno>7</colno> </row-value> </row> - <row rowno="2"> - <row-value> <colno>1</colno> <value>2</value> </row-value> - <row-value> <colno>2</colno> <value>sel12345</value> </row-value> - <row-value> <colno>3</colno> <value>select * from qt_query</value> </row-value> - <row-value> <colno>4</colno> <value>kishore</value> </row-value> - <row-value> <colno>5</colno> <value>2009-04-10 00:00:00.0</value> </row-value> - <row-value> <colno>6</colno> <value>krajkumard</value> </row-value> - <row-value> <colno>7</colno> <value>2010-05-21 00:00:00.0</value> </row-value> </row> - <row rowno="3"> - <row-value> <colno>1</colno> <value>3</value> </row-value> - <row-value> <colno>2</colno> <value>sele123</value> </row-value> - <row-value> <colno>3</colno> - <value> select * from cache where %2scache_name% = ? and %1icache_type% = ? </value> </row-value> - <row-value> <colno>4</colno> <value>krajkumard</value> </row-value> - <row-value> <colno>5</colno> <value>2010-05-21 00:00:00.0</value> </row-value> - <row-value> <colno>6</colno> </row-value> - <row-value> <colno>7</colno> </row-value> </row> - <row rowno="4"> - <row-value> <colno>1</colno> <value>4</value> </row-value> - <row-value> <colno>2</colno> <value>upd</value> </row-value> - <row-value> <colno>3</colno> <value>select * from qt_qtool where %sname=?%</value> </row-value> - <row-value> <colno>4</colno> <value>krajkumard</value> </row-value> - <row-value> <colno>5</colno> <value>2010-05-31 00:00:00.0</value> </row-value> - <row-value> <colno>6</colno> </row-value> - <row-value> <colno>7</colno> <value>2010-06-07 00:00:00.0</value> </row-value> </row> - <row rowno="5"> - <row-value> <colno>1</colno> <value>5</value> </row-value> - <row-value> <colno>2</colno> <value>Pron_errors</value> </row-value> - <row-value> <colno>3</colno> <value>select * from proanalyzer_errors</value> </row-value> - <row-value> <colno>4</colno> <value>tjothy</value> </row-value> - <row-value> <colno>5</colno> <value>2010-06-07 00:00:00.0</value> </row-value> - <row-value> <colno>6</colno> </row-value> - <row-value> <colno>7</colno> </row-value> </row> </rows>

    Read the article

  • Mysqli results memory usage

    - by Poe
    Why is the memory consumption in this query continuing to rise as the internal pointer progresses through loop? How to make this more efficient and lean? $link = mysqli_connect(...); $result = mysqli_query($link,$query); // 403,268 rows in result set while ($row = mysqli_fetch_row($result)) { // print time, (get memory usage), -- row number } mysqli_free_result(); mysqli_close($link); /* 06:55:25 (1240336) -- Run query 06:55:26 (39958736) -- Query finished 06:55:26 (39958784) -- Begin loop 06:55:26 (39960688) -- Row 0 06:55:26 (45240712) -- Row 10000 06:55:26 (50520712) -- Row 20000 06:55:26 (55800712) -- Row 30000 06:55:26 (61080712) -- Row 40000 06:55:26 (66360712) -- Row 50000 06:55:26 (71640712) -- Row 60000 06:55:26 (76920712) -- Row 70000 06:55:26 (82200712) -- Row 80000 06:55:26 (87480712) -- Row 90000 06:55:26 (92760712) -- Row 100000 06:55:26 (98040712) -- Row 110000 06:55:26 (103320712) -- Row 120000 06:55:26 (108600712) -- Row 130000 06:55:26 (113880712) -- Row 140000 06:55:26 (119160712) -- Row 150000 06:55:26 (124440712) -- Row 160000 06:55:26 (129720712) -- Row 170000 06:55:27 (135000712) -- Row 180000 06:55:27 (140280712) -- Row 190000 06:55:27 (145560712) -- Row 200000 06:55:27 (150840712) -- Row 210000 06:55:27 (156120712) -- Row 220000 06:55:27 (161400712) -- Row 230000 06:55:27 (166680712) -- Row 240000 06:55:27 (171960712) -- Row 250000 06:55:27 (177240712) -- Row 260000 06:55:27 (182520712) -- Row 270000 06:55:27 (187800712) -- Row 280000 06:55:27 (193080712) -- Row 290000 06:55:27 (198360712) -- Row 300000 06:55:27 (203640712) -- Row 310000 06:55:27 (208920712) -- Row 320000 06:55:27 (214200712) -- Row 330000 06:55:27 (219480712) -- Row 340000 06:55:27 (224760712) -- Row 350000 06:55:27 (230040712) -- Row 360000 06:55:27 (235320712) -- Row 370000 06:55:27 (240600712) -- Row 380000 06:55:27 (245880712) -- Row 390000 06:55:27 (251160712) -- Row 400000 06:55:27 (252884360) -- End loop 06:55:27 (1241264) -- Free */

    Read the article

  • Flex / Flash builder : no returning data using database

    - by Tristan
    Hello, i'm following some flex tutorials everything's working as wanted expected for one thing : When i use my function getServerByBrand($brand) there is no returned data into my datagrid and i don't know why because it uses the same schema as getAllserver() which is working . I don't know whether it's cause by the function itselft or the configuration in flash builder : protected function RechercheGSP_clickHandler(event:MouseEvent):void { getServerByBrandResult.token = dbClass.getServerByBrand(SearchInput.text); } Here's what i've got in Data/Services : getServerByBrand(brand : string) : Object And finally the function : public function getServerByBrand($brand) { $stmt = mysqli_prepare($this->connection, "SELECT DISTINCT * FROM $this->tablename where GSP_nom=? "); $this->throwExceptionOnError(); mysqli_stmt_execute($stmt); $this->throwExceptionOnError(); $rows = array(); mysqli_stmt_bind_result($stmt, $row->idServ, $row->GSP_nom, $row->IPserv, $row->port, $row->tickrate, $row->membre, $row->nomPays, $row->finContrat, $row->actif, $row->timestamp, $row->type, $row->jeux, $row->slot, $row->ipClient, $row->essai, $row->reussite, $row->echec, $row->valide, $row->email); while (mysqli_stmt_fetch($stmt)) { $row->timestamp = new DateTime($row->timestamp); $rows[] = $row; $row = new stdClass(); mysqli_stmt_bind_result($stmt, $row->idServ, $row->GSP_nom, $row->IPserv, $row->port, $row->tickrate, $row->membre, $row->nomPays, $row->finContrat, $row->actif, $row->timestamp, $row->type, $row->jeux, $row->slot, $row->ipClient, $row->essai, $row->reussite, $row->echec, $row->valide, $row->email); } mysqli_stmt_free_result($stmt); mysqli_close($this->connection); return $rows; } I tested the settings with configure return type and it tells me : "the operation returned a primitive "object". test settings : Parameters (brand) / Input type (String) / Value (woop) To conclude, there is no returned object at all. Do you see the problem ? Thanks

    Read the article

  • adding header row to gridview won't allow you to save the last item row

    - by Lex
    I've modified my GridView to have an extra Header row, however that extra row has caused my grid view row count to be incorrect. Basically, when I want to save the Gridview now, it doesn't recognize the last item line. In my current test I have 5 Item Lines, however only 4 of them are being saved. My code for creating the additional header Line: protected void gvStatusReport_RowDataBound(object sender, GridViewRowEventArgs e) { // This grid has multiple rows, fake the top row. if (e.Row.RowType == DataControlRowType.Header) { SortedList FormatCells = new SortedList(); FormatCells.Add("1", ",6,1"); FormatCells.Add("2", "Time Spent,7,1"); FormatCells.Add("3", "Total,2,1"); FormatCells.Add("4", ",6,1"); GetMultiRowHeader(e, FormatCells); } } The function to create a new row: public void GetMultiRowHeader(GridViewRowEventArgs e, SortedList GetCels) { GridViewRow row; IDictionaryEnumerator enumCels = GetCels.GetEnumerator(); row = new GridViewRow(-1, -1, DataControlRowType.Header, DataControlRowState.Normal); while (enumCels.MoveNext()) { string[] count = enumCels.Value.ToString().Split(Convert.ToChar(",")); TableCell cell = new TableCell(); cell.RowSpan = Convert.ToInt16(count[2].ToString()); cell.ColumnSpan = Convert.ToInt16(count[1].ToString()); cell.Controls.Add(new LiteralControl(count[0].ToString())); cell.HorizontalAlign = HorizontalAlign.Center; row.Cells.Add(cell); } e.Row.Parent.Controls.AddAt(0, row); } Then when I'm going to save, I loop through the rows: int totalRows = gvStatusReport.Rows.Count; for (int rowNumber = 0; rowNumber < totalRows; rowNumber++) { However the first line doesn't seem to have any of the columns that the item row has, and the last line doesn't even show up. My problem is that I do need the extra header line, but what is the best way to fix this?

    Read the article

  • jQuery Clone and add row to last row

    - by user198880
    I want to add a row whenever the user click on the new button.I want to clone the row "tRow0" and add it to the last row of the table "tblEquipment tbody".I wrote a JavaScript function for adding the row(AddEquipment).The problem is that the row is not getting added in the last row. clone row : tRow0 last row : tRow1 Actually the new row must added after the "tRow1" row.But the new row get added below "trActivity1_2" row.Please provide me the solution. my javascript function: function AddEquipment() { var row = jQuery('#tRow0').clone(true).show().insertAfter('#tblEquipment tbody>tr:last'); var index = document.getElementById("hdnMaxEqpId").value; jQuery("#tblEquipment tbody>tr:last").attr("id", "tRow" + index) jQuery("td:eq(0) input", row).attr("id", "chkEqp" + index); jQuery("td:eq(1) div:eq(0)", row).attr("id", "divEqpName" + index); jQuery("td:eq(1) input:eq(0)", row).attr("id", "hdnWODefEqpId" + index).attr("name", "hdnWODefEqpId" + index); jQuery("td:eq(1) input:eq(1)", row).attr("id", "hdnEquipmentId" + index).attr("name", "hdnEquipmentId" + index).attr("onpropertychange",""); jQuery("td:eq(1) input:eq(2)", row).attr("id", "txtEquipment" + index).attr("name", "txtEquipment" + index); jQuery("td:eq(1) img", row).attr("id", "imgshowEquipmentTree" + index).attr("onclick", ""); jQuery("td:eq(1) div:eq(1)", row).attr("id", "divEqpImage" + index); jQuery("td:eq(2) div", row).attr("id", "divEqpHierarchy" + index); jQuery("td:eq(3) textarea", row).attr("id", "txtEqRemarks" + index); jQuery("td:eq(4) img", row).attr("id", "imgEqAttachment" + index); } my aspx page: <table id="tblEquipment"> <thead> <tr> <th> </th> <th> Equipment</th> <th> Hierarchy</th> <th> Remarks</th> <th> Attachment</th> <th> Total Cost</th> </tr> </thead> <tbody id="tbEquipment"> <tr id="tRow0" class="trChildItem"> <td> <input id="chkEqp0" name="chkEqp0" type="checkbox" /> </td> <td> <div id="divEqpName0"> <input id="hdnWODefEqpId0" name="hdnWODefEqpId0" type="hidden" value="0" /> <input id="hdnEquipmentId0" name="hdnEquipmentId0" onpropertychange="AutoSaveEquipment(0);" type="hidden" value="0" /> <input id="txtEquipment0" class="clsSpText" name="txtEquipment0" readonly /> </div> <div id="divEqpImage0"> </div> </td> <td> <div id="divEqpHierarchy0"> &nbsp;</div> </td> <td> <textarea id="txtEqRemarks0" class="clsSpTextArea" cols="20" name="txtEqRemarks0" rows="1"></textarea> </td> <td> </td> </tr> <tr id="tActMaster0" class="trInnerChildItem"> <td> </td> <td colspan="5"> <div id="divActivitiesdetails0"> </div> </td> </tr> <tr id="tRow1" class="trChildItem"> <td> <input id="chkEqp1" runat="server" type="checkbox" /> <div id="divEqpEdit1"> </div> </td> <td> <div id="divEqpName1"> <input id="hdnWODefEqpId1" runat="server" type="hidden" value="7" /> <input id="hdnEquipmentId1" runat="server" type="hidden" value="4" /> <div id="divEqp1"> e2</div> <div id="divEqpImage1"> <a id="activiy1" onclick="HideActivities(1)"> </div> </td> <td> <div id="divEqpHierarchy1"> Equipment--&gt;e2</div> </td> <td> <div id="divEqpRemarks1"> Remarks</div> </td> <td> <div> </div> </td> <td> <div> $0.00</div> </td> </tr> <tr id="tActMaster1" class="trInnerChildItem" jquery1275984958765="3"> <td> </td> <td colspan="5"> <div id="divActivitiesdetails1"> <div id="divActivityMaster"> <table> <thead> <tr> <th> <a onclick="ActivityPopUp(0,1)"> </a></th> <th> Activity</th> <th> Description</th> <th> Duration</th> </tr> </thead> <tbody id="tbActivity"> <tr id="trActivity1_1" class="trChildItem" ondblclick="ActivityPopUp(3,1)" onmouseleave="HideActEditDiv('1_1')" onmouseover="ShowActEditDiv('1_1',7,1)"> <td> <div id="divActEdit1_1"> </div> </td> <td> <input id="hdnDefActivityId1_1" runat="server" type="hidden" value="33333" /> <div id="divActivityName1_1"> Act1</div> </td> <td> <div id="divActivityDesc1_1"> Ac1</div> </td> <td> <div id="divActivityDuration1_1"> 1&nbsp;Day</div> </td> </tr> <tr id="trActivity1_2" class="trChildItem" ondblclick="ActivityPopUp(3,1)" onmouseleave="HideActEditDiv('1_2')" onmouseover="ShowActEditDiv('1_2',7,1)"> <td> <div id="divActEdit1_2"> </div> </td> <td> <input id="hdnDefActivityId1_2" runat="server" type="hidden" value="4" /> <div id="divActivityName1_2"> Act2</div> </td> <td> <div id="divActivityDesc1_2"> Act2Desc</div> </td> <td> <div id="divActivityDuration1_2"> 1&nbsp;Day</div> </td> </tr> </tbody> </table> </div> </div> </td> </tr> </tbody> </table>

    Read the article

  • cellForRowAtIndexPath: crashes when trying to access the indexPath.row/[indexPath row]

    - by Emil
    Hey. I am loading in data to a UITableView, from a custom UITableViewCell (own class and nib). It works great, until I try to access the indexPath.row/[indexPath.row]. I'll post my code first, it will probably be easier for you to understand what I mean then. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CustomCell"; CustomCell *cell = (CustomCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil){ NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil]; for (id currentObject in topLevelObjects){ if ([currentObject isKindOfClass:[CustomCell class]]){ cell = (CustomCell *) currentObject; break; } } } NSLog(@"%@", indexPath.row); // Configure the cell... NSUInteger row = indexPath.row; cell.titleLabel.text = [postsArrayTitle objectAtIndex:indexPath.row]; cell.dateLabel.text = [postsArrayDate objectAtIndex:indexPath.row]; cell.cellImage.image = [UIImage imageWithContentsOfFile:[postsArrayImg objectAtIndex:indexPath.row]]; NSLog(@"%@", indexPath.row); return cell; } The odd thing is, it does work when it loads in the first three cells (they are 125px high), but crashes when I try to scroll down. The indexPath is always avaliable, but not the indexPath.row, and I have no idea why it isn't! Please help me.. Thanks. Additional error code: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x5d10c20' *** Call stack at first throw: ( 0 CoreFoundation 0x0239fc99 __exceptionPreprocess + 185 1 libobjc.A.dylib 0x024ed5de objc_exception_throw + 47 2 CoreFoundation 0x023a17ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 3 CoreFoundation 0x02311496 ___forwarding___ + 966 4 CoreFoundation 0x02311052 _CF_forwarding_prep_0 + 50 5 MyFancyAppName 0x00002d1c -[HomeTableViewController tableView:cellForRowAtIndexPath:] + 516 [...])

    Read the article

  • UITableView not responding to row selection until a different row is selected

    - by Larry Fransson
    This is driving me nuts. I have searched on everything I can think of to find a solution but haven't found one yet. I've got a UITableView that uses custom cells. The accessory is the detail disclosure button. I would like the cell to respond to either row selection or the disclosure button being tapped. It responds to the disclosure button just as you would expect. But selecting the row is a different story. When I select the row, it highlights, but nothing happens until I tap a different row. Then the previously selected row does what it was supposed to do, which is to create and push a new view controller for that row. If I tap a single row five times and then tap a different row, it then creates and pushes five view controllers for that first row. It does this both in the simulator and on the device. What's really maddening is that I have another tableview in the same application that responds correctly to row selection or tapping the detail disclosure button. I can't find anything I've done differently between the two. Has anyone seen this before?

    Read the article

  • ASP.NET GridView second header row to span main header row

    - by Dana Robinson
    I have an ASP.NET GridView which has columns that look like this: | Foo | Bar | Total1 | Total2 | Total3 | Is it possible to create a header on two rows that looks like this? | | Totals | | Foo | Bar | 1 | 2 | 3 | The data in each row will remain unchanged as this is just to pretty up the header and decrease the horizontal space that the grid takes up. The entire GridView is sortable in case that matters. I don't intend for the added "Totals" spanning column to have any sort functionality. Edit: Based on one of the articles given below, I created a class which inherits from GridView and adds the second header row in. namespace CustomControls { public class TwoHeadedGridView : GridView { protected Table InnerTable { get { if (this.HasControls()) { return (Table)this.Controls[0]; } return null; } } protected override void OnDataBound(EventArgs e) { base.OnDataBound(e); this.CreateSecondHeader(); } private void CreateSecondHeader() { GridViewRow row = new GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal); TableCell left = new TableHeaderCell(); left.ColumnSpan = 3; row.Cells.Add(left); TableCell totals = new TableHeaderCell(); totals.ColumnSpan = this.Columns.Count - 3; totals.Text = "Totals"; row.Cells.Add(totals); this.InnerTable.Rows.AddAt(0, row); } } } In case you are new to ASP.NET like I am, I should also point out that you need to: 1) Register your class by adding a line like this to your web form: <%@ Register TagPrefix="foo" NameSpace="CustomControls" Assembly="__code"%> 2) Change asp:GridView in your previous markup to foo:TwoHeadedGridView. Don't forget the closing tag. Another edit: You can also do this without creating a custom class. Simply add an event handler for the DataBound event of your grid like this: protected void gvOrganisms_DataBound(object sender, EventArgs e) { GridView grid = sender as GridView; if (grid != null) { GridViewRow row = new GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal); TableCell left = new TableHeaderCell(); left.ColumnSpan = 3; row.Cells.Add(left); TableCell totals = new TableHeaderCell(); totals.ColumnSpan = grid.Columns.Count - 3; totals.Text = "Totals"; row.Cells.Add(totals); Table t = grid.Controls[0] as Table; if (t != null) { t.Rows.AddAt(0, row); } } } The advantage of the custom control is that you can see the extra header row on the design view of your web form. The event handler method is a bit simpler, though.

    Read the article

  • [ASP.NET 4.0] Persisting Row Selection in Data Controls

    - by HosamKamel
    Data Control Selection Feature In ASP.NET 2.0: ASP.NET Data Controls row selection feature was based on row index (in the current page), this of course produce an issue if you try to select an item in the first page then navigate to the second page without select any record you will find the same row (with the same index) selected in the second page! In the sample application attached: Select the second row in the books GridView. Navigate to second page without doing any selection You will find the second row in the second page selected. Persisting Row Selection: Is a new feature which replace the old selection mechanism which based on row index to be based on the row data key instead. This means that if you select the third row on page 1 and move to page 2, nothing is selected on page 2. When you move back to page 1, the third row is still selected. Data Control Selection Feature In ASP.NET 3.5 SP1: The Persisting Row Selection was initially supported only in Dynamic Data projects Data Control Selection Feature In ASP.NET 4.0: Persisted selection is now supported for the GridView and ListView controls in all projects. You can enable this feature by setting the EnablePersistedSelection property, as shown below: Important thing to note, once you enable this feature you have to set the DataKeyNames property too because as discussed the full approach is based on the Row Data Key Simple feature but  is a much more natural behavior than the behavior in earlier versions of ASP.NET. Download Demo Project

    Read the article

  • Highlight Row in GridView with Colored Columns

    - by Vincent Maverick Durano
    I wrote a blog post a while back before here that demonstrate how to highlight a GridView row on mouseover and as you can see its very easy to highlight rows in GridView. One of my colleague uses the same technique for implemeting gridview row highlighting but the problem is that if a Column has background color on it that cell will not be highlighted anymore. To make it more clear then let's build up a sample application. ASPX:   1: <asp:GridView runat="server" id="GridView1" onrowcreated="GridView1_RowCreated" 2: onrowdatabound="GridView1_RowDataBound"> 3: </asp:GridView>   CODE BEHIND:   1: private DataTable FillData() { 2:   3: DataTable dt = new DataTable(); 4: DataRow dr = null; 5:   6: //Create DataTable columns 7: dt.Columns.Add(new DataColumn("RowNumber", typeof(string))); 8: dt.Columns.Add(new DataColumn("Col1", typeof(string))); 9: dt.Columns.Add(new DataColumn("Col2", typeof(string))); 10: dt.Columns.Add(new DataColumn("Col3", typeof(string))); 11:   12: //Create Row for each columns 13: dr = dt.NewRow(); 14: dr["RowNumber"] = 1; 15: dr["Col1"] = "A"; 16: dr["Col2"] = "B"; 17: dr["Col3"] = "C"; 18: dt.Rows.Add(dr); 19:   20: dr = dt.NewRow(); 21: dr["RowNumber"] = 2; 22: dr["Col1"] = "AA"; 23: dr["Col2"] = "BB"; 24: dr["Col3"] = "CC"; 25: dt.Rows.Add(dr); 26:   27: dr = dt.NewRow(); 28: dr["RowNumber"] = 3; 29: dr["Col1"] = "A"; 30: dr["Col2"] = "B"; 31: dr["Col3"] = "CC"; 32: dt.Rows.Add(dr); 33:   34: dr = dt.NewRow(); 35: dr["RowNumber"] = 4; 36: dr["Col1"] = "A"; 37: dr["Col2"] = "B"; 38: dr["Col3"] = "CC"; 39: dt.Rows.Add(dr); 40:   41: dr = dt.NewRow(); 42: dr["RowNumber"] = 5; 43: dr["Col1"] = "A"; 44: dr["Col2"] = "B"; 45: dr["Col3"] = "CC"; 46: dt.Rows.Add(dr); 47:   48: return dt; 49: } 50:   51: protected void Page_Load(object sender, EventArgs e) { 52: if (!IsPostBack) { 53: GridView1.DataSource = FillData(); 54: GridView1.DataBind(); 55: } 56: }   As you can see there's nothing fancy in the code above. It just contain a method that fills a DataTable with a dummy data on it. Now here's the code for row highlighting:   1: protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { 2: //Set Background Color for Columns 1 and 3 3: e.Row.Cells[1].BackColor = System.Drawing.Color.Beige; 4: e.Row.Cells[3].BackColor = System.Drawing.Color.Red; 5:   6: //Attach onmouseover and onmouseout for row highlighting 7: e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='Blue'"); 8: e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=''"); 9: }   Running the code above will show something like this in the browser: On initial load: On mouseover of GridView row:   Noticed that Col1 and Col3 are not highlighted. Why? the reason is that Col1 and Col3 cells has background color set on it and we only highlight the rows (TR) and not the columns (TD) that's why on mouseover only the rows will be highlighted. To fix the issue we will create a javascript method that would remove the background color of the columns when highlighting a row and on mouseout set back the original color that is set on Col1 and Col3. Here are the codes below: JavaScript   1: <script type="text/javascript"> 2: function HighLightRow(rowIndex, colIndex,colIndex2, flag) { 3: var gv = document.getElementById("<%= GridView1.ClientID %>"); 4: var selRow = gv.rows[rowIndex]; 5: if (rowIndex > 0) { 6: if (flag == "sel") { 7: gv.rows[rowIndex].style.backgroundColor = 'Blue'; 8: gv.rows[rowIndex].style.color = "White"; 9: gv.rows[rowIndex].cells[colIndex].style.backgroundColor = ''; 10: gv.rows[rowIndex].cells[colIndex2].style.backgroundColor = ''; 11: } 12: else { 13: gv.rows[rowIndex].style.backgroundColor = ''; 14: gv.rows[rowIndex].style.color = "Black"; 15: gv.rows[rowIndex].cells[colIndex].style.backgroundColor = 'Beige'; 16: gv.rows[rowIndex].cells[colIndex2].style.backgroundColor = 'Red'; 17: } 18: } 19: } 20: </script>   The HighLightRow method is a javascript function that accepts four (4) parameters which are the rowIndex,colIndex,colIndex2 and the flag. The rowIndex is the current row index of the selected row in GridView. The colIndex is the index of Col1 and colIndex2 is the index of col3. We are passing these index because these columns has background color on it and we need to toggle its backgroundcolor when highlighting the row in GridView. Finally the flag is something that would determine if its selected or not. Now here's the code for calling the JavaScript function above.     1: protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { 2:   3: //Set Background Color for Columns 1 and 3 4: e.Row.Cells[1].BackColor = System.Drawing.Color.Beige; 5: e.Row.Cells[3].BackColor = System.Drawing.Color.Red; 6:   7: //Attach onmouseover and onmouseout for row highlighting 8: //and call the HighLightRow method with the required parameters 9: int index = e.Row.RowIndex + 1; 10: e.Row.Attributes.Add("onmouseover", "HighLightRow(" + index + "," + 1 + "," + 3 + ",'sel')"); 11: e.Row.Attributes.Add("onmouseout", "HighLightRow(" + index + "," + 1 + "," + 3 + ",'dsel')"); 12: 13: }   Running the code above will display something like this: On initial load:   On mouseover of GridView row:   That's it! I hope someone find this post useful!

    Read the article

  • MySQL: Insert row on table2 if row in table1 exists

    - by Andrew M
    I'm trying to set up a MySQL query that will insert a row into table2 if a row in table1 exist already, otherwise it will just insert the row into table1. I need to find a way to adapt the following query into inserting a row into table2 with the existing row's id. INSERT INTO table1 (host, path) VALUES ('youtube.com', '/watch') IF NOT EXISTS ( SELECT * FROM table1 WHERE host='youtube.com' AND path='/watch' LIMIT 1); Something kind of like this: INSERT ... IF NOT EXISTS(..) ELSE INSERT INTO table2 (table1_id) VALUES(row.id); Except I don't know the syntax for this.

    Read the article

  • parentNode.parentNode.rowindex to delete a row in a dynamic table

    - by billy85
    I am creating my rows dynamically when the user clicks on "Ajouter". <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script> function getXhr(){ var xhr = null; if(window.XMLHttpRequest) // Firefox and others xhr = new XMLHttpRequest(); else if(window.ActiveXObject){ // Internet Explorer try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } } else { // XMLHttpRequest not supported by your browser alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); xhr = false; } return xhr } /** * method called when the user clicks on the button */ function go(){ var xhr = getXhr() // We defined what we gonna do with the response xhr.onreadystatechange = function(){ // We do somthing once the server's response is OK if(xhr.readyState == 4 && xhr.status == 200){ //alert(xhr.responseText); var body = document.getElementsByTagName("body")[0]; // Retrieve <table> ID and create a <tbody> element var tbl = document.getElementById("table"); var tblBody = document.createElement("tbody"); var row = document.createElement("tr"); // Create <td> elements and a text node, make the text // node the contents of the <td>, and put the <td> at // the end of the table row var cell_1 = document.createElement("td"); var cell_2 = document.createElement("td"); var cell_3 = document.createElement("td"); var cell_4 = document.createElement("td"); // Create the first cell which is a text zone var cell1=document.createElement("input"); cell1.type="text"; cell1.name="fname"; cell1.size="20"; cell1.maxlength="50"; cell_1.appendChild(cell1); // Create the second cell which is a text area var cell2=document.createElement("textarea"); cell2.name="fdescription"; cell2.rows="2"; cell2.cols="30"; cell_2.appendChild(cell2); var cell3 = document.createElement("div"); cell3.innerHTML=xhr.responseText; cell_3.appendChild(cell3); // Create the fourth cell which is a href var cell4 = document.createElement("a"); cell4.appendChild(document.createTextNode("[Delete]")); cell4.setAttribute("href","javascrit:deleteRow();"); cell_4.appendChild(cell4); // add cells to the row row.appendChild(cell_1); row.appendChild(cell_2); row.appendChild(cell_3); row.appendChild(cell_4); // add the row to the end of the table body tblBody.appendChild(row); // put the <tbody> in the <table> tbl.appendChild(tblBody); // appends <table> into <body> body.appendChild(tbl); // sets the border attribute of tbl to 2; tbl.setAttribute("border", "1"); } } xhr.open("GET","fstatus.php",true); xhr.send(null); } </head> <body > <h1> Create an Item </h1> <form method="post"> <table align="center" border = "2" cellspacing ="0" cellpadding="3" id="table"> <tr><td><b>Functionality Name:</b></td> <td><b>Description:</b></td> <td><b>Status:</b></td> <td><input type="button" Name= "Ajouter" Value="Ajouter" onclick="go()"></td></tr> </table> </form> </body> </html> Now, I would like to use the href [Delete] to delete one particular row. I wrote this: <script type="text/javascript"> function deleteRow(r){ var i=r.parentNode.parentNode.rowIndex; document.getElementById('table').deleteRow(i); } </script> When I change the first code like this: cell4.setAttribute("href","javascrit:deleteRow(this);"); I got an error: The page cannot be displayed. I am redirected to a new pagewhich can not be displayed. How could I delete my row by using the function deleteRow(r)? table is the id of my table Thanks. Billy85

    Read the article

  • Delphi - restore actual row in DBGrid

    - by durumdara
    Hi! D6 prof. Formerly we used DBISAM and DBISAMTable. That handle the RecNo, and it is working good with modifications (Delete, edit, etc). Now we replaced with ElevateDB, that don't handle RecNo, and many times we use Queries, not Tables. Query must reopen to see the modifications. But if we Reopen the Query, we need to repositioning to the last record. Locate isn't enough, because Grid is show it in another Row. This is very disturbing thing, because after the modification record is moving into another row, you hard to follow it, and users hate this. We found this code: function TBaseDBGrid.GetActRow: integer; begin Result := -1 + Row; end; procedure TBasepDBGrid.SetActRow(aRow: integer); var bm : TBookMark; begin if IsDataSourceValid(DataSource) then with DataSource.DataSet do begin bm := GetBookmark; DisableControls; try MoveBy(-aRow); MoveBy(aRow); //GotoBookmark(bm); finally FreebookMark(bm); EnableControls; end; end; end; The original example is uses moveby. This working good with Queries, because we cannot see that Query reopened in the background, the visual control is not changed the row position. But when we have EDBTable, or Live/Sensitive Query, the MoveBy is dangerous to use, because if somebody delete or append a new row, we can relocate into wrong record. Then I tried to use the BookMark (see remark). But this technique isn't working, because it is show the record in another Row position... So the question: how to force both the row position and record in DBGrid? Or what kind of DBGrid can relocate to the record/row after the underlying DataSet refreshed? I search for user friendly solution, I understand them, because I tried to use this jump-across DBGrid, and very bad to use, because my eyes are getting out when try to find the original record after update... :-( Thanks for your every help, link, info: dd

    Read the article

  • row operation in same table and same coloumns

    - by Raj
    Hi! i have a little problem to discuss i hope it will easy for you. suppose i have table A with 2 columns as item price milk 25 milk 50 milk 100 Butter 25 Butter 100 Butter 200 now i want to display a table B derived from table A as item price growth rate milk 0 milk 100 milk 100 Butter 100 Butter 200 Butter 100 formula for growth rate for row1 is ((row[1]-row[0])/row[0])*100 eg for 1st row ((50-25)/25)*100 can you suggest a SQl Query for it

    Read the article

  • Java Swing - Adding a row # column (row header) to a JTable

    - by llm
    I have data from a database loaded into a JTable through a custom table model. I want to have a column (should be the first column) which simply shows the display row number (i.e. it is not tied to any data (or sorting) but is simply the row number on the screen starting at 1). These "row headers" should be grayed out like the row headers. Any idea how to do this? Thanks

    Read the article

  • mysql prevent displaying a row ONE which has reference in another row TWO but no reference in row THREE

    - by Jayapal Chandran
    I have a table like the following id | name | pid 1 | sam | NULL 2 | sams ref | 1 3 | pam | NULL For the first time the first row gets inserted which will have pid as null I insert a row which is related to the first row and then i insert a row which is new and which may be referred by another row in future. now i want only the third row to be displayed and not the first and second row as the second row contains the reference of first row. so if any row has a reference to another row then both the rows should not be displayed. Only rows which is not having any reference should be displayed. BESIDES, IS IT A GOOD PRACTICE? PLEASE ADVICE ON THIS. Edited When i updated in server the query is always giving empty result. here is what i have and this one When pid is NULL then that row should appear but when another entry in the same table with pid as its parent id or any other rows id appears then both the rows should not appear. so if any pid has been referred then both the rows should not appear. here only one row will refer another row and not more than that. in my localhost i have mysql version 5.0.1 or something like that but when i installed xampp in another system it had 5.5 and in the live server it was 5.3 so in version around 5.0 the query is returning rows but in higher versions it is returning empty rows. so now i this case how to make a query?

    Read the article

  • Row Number Transformation

    The Row Number Transformation calculates a row number for each row, and adds this as a new output column to the data flow. The column number is a sequential number, based on a seed value. Each row receives the next number in the sequence, based on the defined increment value. The final row number can be stored in a variable for later analysis, and can be used as part of a process to validate the integrity of the data movement. The Row Number transform has a variety of uses, such as generating surrogate keys, or as the basis for a data partitioning scheme when combined with the Conditional Split transformation. Properties Property Data Type Description Seed Int32 The first row number or seed value. Increment Int32 The value added to the previous row number to make the next row number. OutputVariable String The name of the variable into which the final row number is written post execution. (Optional). The three properties have been configured to support expressions, or they can set directly in the normal manner. Expressions on components are only visible on the hosting Data Flow task, not at the individual component level. Sometimes the data type of the property is incorrectly set when the properties are created, see the Troubleshooting section below for details on how to fix this. Installation The component is provided as an MSI file which you can download and run to install it. This simply places the files on disk in the correct locations and also installs the assemblies in the Global Assembly Cache as per Microsoft’s recommendations. You may need to restart the SQL Server Integration Services service, as this caches information about what components are installed, as well as restarting any open instances of Business Intelligence Development Studio (BIDS) / Visual Studio that you may be using to build your SSIS packages. For 2005/2008 Only - Finally you will have to add the transformation to the Visual Studio toolbox manually. Right-click the toolbox, and select Choose Items.... Select the SSIS Data Flow Items tab, and then check the Row Number transformation in the Choose Toolbox Items window. This process has been described in detail in the related FAQ entry for How do I install a task or transform component? We recommend you follow best practice and apply the current Microsoft SQL Server Service pack to your SQL Server servers and workstations, and this component requires a minimum of SQL Server 2005 Service Pack 1. Downloads The Row Number Transformation  is available for SQL Server 2005, SQL Server 2008 (includes R2) and SQL Server 2012. Please choose the version to match your SQL Server version, or you can install multiple versions and use them side by side if you have more than one version of SQL Server installed. Row Number Transformation for SQL Server 2005 Row Number Transformation for SQL Server 2008 Row Number Transformation for SQL Server 2012 Version History SQL Server 2012 Version 3.0.0.6 - SQL Server 2012 release. Includes upgrade support for both 2005 and 2008 packages to 2012. (5 Jun 2012) SQL Server 2008 Version 2.0.0.5 - SQL Server 2008 release. (15 Oct 2008) SQL Server 2005 Version 1.2.0.34 – Updated installer. (25 Jun 2008) Version 1.2.0.7 - SQL Server 2005 RTM Refresh. SP1 Compatibility Testing. Added the ability to reuse an existing column to hold the generated row number, as an alternative to the default of adding a new column to the output. (18 Jun 2006) Version 1.2.0.7 - SQL Server 2005 RTM Refresh. SP1 Compatibility Testing. Added the ability to reuse an existing column to hold the generated row number, as an alternative to the default of adding a new column to the output. (18 Jun 2006) Version 1.0.0.0 - Public Release for SQL Server 2005 IDW 15 June CTP (29 Aug 2005) Screenshot Code Sample The following code sample demonstrates using the Data Generator Source and Row Number Transformation programmatically in a very simple package. Package package = new Package(); package.Name = "Data Generator & Row Number"; // Add the Data Flow Task Executable taskExecutable = package.Executables.Add("STOCK:PipelineTask"); // Get the task host wrapper, and the Data Flow task TaskHost taskHost = taskExecutable as TaskHost; MainPipe dataFlowTask = (MainPipe)taskHost.InnerObject; // Add Data Generator Source IDTSComponentMetaData100 componentSource = dataFlowTask.ComponentMetaDataCollection.New(); componentSource.Name = "Data Generator"; componentSource.ComponentClassID = "Konesans.Dts.Pipeline.DataGenerator.DataGenerator, Konesans.Dts.Pipeline.DataGenerator, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b2ab4a111192992b"; CManagedComponentWrapper instanceSource = componentSource.Instantiate(); instanceSource.ProvideComponentProperties(); instanceSource.SetComponentProperty("RowCount", 10000); // Add Row Number Tx IDTSComponentMetaData100 componentRowNumber = dataFlowTask.ComponentMetaDataCollection.New(); componentRowNumber.Name = "FlatFileDestination"; componentRowNumber.ComponentClassID = "Konesans.Dts.Pipeline.RowNumberTransform.RowNumberTransform, Konesans.Dts.Pipeline.RowNumberTransform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b2ab4a111192992b"; CManagedComponentWrapper instanceRowNumber = componentRowNumber.Instantiate(); instanceRowNumber.ProvideComponentProperties(); instanceRowNumber.SetComponentProperty("Increment", 10); // Connect the two components together IDTSPath100 path = dataFlowTask.PathCollection.New(); path.AttachPathAndPropagateNotifications(componentSource.OutputCollection[0], componentRowNumber.InputCollection[0]); #if DEBUG // Save package to disk, DEBUG only new Application().SaveToXml(String.Format(@"C:\Temp\{0}.dtsx", package.Name), package, null); #endif package.Execute(); foreach (DtsError error in package.Errors) { Console.WriteLine("ErrorCode : {0}", error.ErrorCode); Console.WriteLine(" SubComponent : {0}", error.SubComponent); Console.WriteLine(" Description : {0}", error.Description); } package.Dispose(); Troubleshooting Make sure you have downloaded the version that matches your version of SQL Server. We offer separate downloads for SQL Server 2005, SQL Server 2008 and SQL Server 2012. If you get an error when you try and use the component along the lines of The component could not be added to the Data Flow task. Please verify that this component is properly installed.  ... The data flow object "Konesans ..." is not installed correctly on this computer, this usually indicates that the internal cache of SSIS components needs to be updated. This is held by the SSIS service, so you need restart the the SQL Server Integration Services service. You can do this from the Services applet in Control Panel or Administrative Tools in Windows. You can also restart the computer if you prefer. You may also need to restart any current instances of Business Intelligence Development Studio (BIDS) / Visual Studio that you may be using to build your SSIS packages. Once installation is complete you need to manually add the task to the toolbox before you will see it and to be able add it to packages - How do I install a task or transform component? Please also make sure you have installed a minimum of SP1 for SQL 2005. The IDtsPipelineEnvironmentService was added in SQL Server 2005 Service Pack 1 (SP1) (See  http://support.microsoft.com/kb/916940). If you get an error Could not load type 'Microsoft.SqlServer.Dts.Design.IDtsPipelineEnvironmentService' from assembly 'Microsoft.SqlServer.Dts.Design, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'. when trying to open the user interface, it implies that your development machine has not had SP1 applied. Very occasionally we get a problem to do with the properties not being created with the correct data type. Since there is no way to programmatically to define the data type of a pipeline component property, it can only infer it. Whilst we set an integer value as we create the property, sometimes SSIS decides to define it is a decimal. This is often highlighted when you use a property expression against the property and get an error similar to Cannot convert System.Int32 to System.Decimal. Unfortunately this is beyond our control and there appears to be no pattern as to when this happens. If you do have more information we would be happy to hear it. To fix this issue you can manually edit the package file. In Visual Studio right click the package file from the Solution Explorer and select View Code, which will open the package as raw XML. You can now search for the properties by name or the component name. You can then change the incorrect property data types highlighted below from Decimal to Int32. <component id="37" name="Row Number Transformation" componentClassID="{BF01D463-7089-41EE-8F05-0A6DC17CE633}" … >     <properties>         <property id="38" name="UserComponentTypeName" …>         <property id="41" name="Seed" dataType="System.Int32" ...>10</property>         <property id="42" name="Increment" dataType="System.Decimal" ...>10</property>         ... If you are still having issues then contact us, but please provide as much detail as possible about error, as well as which version of the the task you are using and details of the SSIS tools installed.

    Read the article

  • PowerShell dataGridView - Copy only one Row into an other dataGridView

    - by Marcel L.
    I´ve got a very short question about the "dataGridView". I´m developing with the Microsoft PowerShell and I want to copy one Row (from $dataGridView1) to the other ($dataGridView2). With this Code I can only Copy the Value of the last focused Cell. I´ve tried to make this for a whole Row, but it´s only working with Cells. Here is my Code: **$btnListeAdd.Add_Click({ $Row = $dataGridView1.Rows[ $dataGridView1.CurrentCell.RowIndex ] $dataGridView2.Rows.Add( $dataGridView1.CurrentCell.Value ) $dataGridView1.Rows.Remove( $Row ) }) $tabListe.Controls.Add($btnListeAdd)** Only the market Cell in $dataGridView1 (similar Column 1 or 2) will be cloned in Column1 in $dataGridView2 - in a extra Row, yey. Thanks for helping me. Please show mercy. It´s my first day with the PowerShell. Kind regards, Marcel L.

    Read the article

  • c# gridview row click

    - by Martijn
    When i click on a row in my gridview, i want to go to a other page with the id i get from the database. In my RowCreated event i have the following line: e.Row.Attributes.Add("onClick", ClientScript.GetPostBackClientHyperlink(this.grdSearchResults, "Select$" + e.Row.RowIndex)); To prevent error messages i have this code: protected override void Render(HtmlTextWriter writer) { // .NET will refuse to accept "unknown" postbacks for security reasons. Because of this we have to register all possible callbacks // This must be done in Render, hence the override for (int i = 0; i < grdSearchResults.Rows.Count; i++) { Page.ClientScript.RegisterForEventValidation(new System.Web.UI.PostBackOptions(grdSearchResults, "Select$" + i.ToString())); } // Do the standard rendering stuff base.Render(writer); } My question is, how can i give a row a unique id (from the DB) and when i click the row, another page is opened (like clicking on a href) and that page can read the id. Thnx

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >