Search Results

Search found 14593 results on 584 pages for 'pat inside'.

Page 45/584 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • Calling a datatrigger for a radio button inside a datagrid

    - by Farax
    I have a datagrid with one column having a radio button. I want to set the GroupName when a certain condition is reached. Below is the code <Custom:DataGrid.Columns> <!-- ONLY ENABLED WHEN THE ITEM TYPE IS SINGLESELECT OR SINGLESELECT WITH ADDIOTIONAL DATA--> <Custom:DataGridTemplateColumn CanUserResize="False" MinWidth="20" > <Custom:DataGridTemplateColumn.CellTemplate> <DataTemplate> <RadioButton IsChecked="{Binding IsChecked}" d:DesignWidth="16" d:DesignHeight="16" GroupName="SingleChoiceSelection" Template="{DynamicResource RadioButtonTemplate}" Background="{DynamicResource BackgroundNew}" BorderBrush="#FF7A7171" Foreground="#FF6C6C6C" Margin="0" /> </DataTemplate> </Custom:DataGridTemplateColumn.CellTemplate> </Custom:DataGridTemplateColumn> <Custom:DataGridTextColumn Header="Choices" Binding="{Binding ChoiceText}" CellStyle="{DynamicResource DataGridCellStyle2}" MinWidth="150" /> </Custom:DataGrid.Columns> </Custom:DataGrid> The ItemSource contains a property called isChecked and I want to change the foreground color when isChecked is changed to true. How do i do this with a datatrigger?

    Read the article

  • GridView paging inside an UpdatePanel or PlaceHolder components

    - by John
    Hello, I'm new to ASP.NET. Im developing ASP.NET C# web form which creating GridView components dynamically and filling them using the data received from my webservice. I'm creating these GridView components programmatically in server-side (cs file)- it has to be flexible - 1 GridView and sometimes 10 GridView components. The problem occurs when I'm trying to add pagination - whenever the user clicks the "next" page, the whole page is getting refreshed because of a postBack and I'm loosing all my data and the page returns Blank/Empty. I used PlaceHolder to hold the GridView components, while searching for a solution, I found UpdatePanel as a better alternative - as far as I understand the page can be partially refreshed - which means that only the UpdatePanel has to be refreshed...but it doesn't work. The following code sample is my TEST, the UpdatePanel is the only component initiated in the client side (aspx page), the rest initiated programmatically in CS. how can I solve the issue described above? Why does the whole page is getting refreshed and I'm loosing my data? can you recommend another way? can provide me with any code sample? If I'm not rebuilding the GridView, it doesn't work... Here is my Default.aspx.cs: public partial class TestAjaxForm : System.Web.UI.Page { DataTable table; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) bindGridView(); } public void bindGridView() { GridView gridView1 = new GridView(); gridView1.AutoGenerateColumns = true; gridView1.PageSize = 2; gridView1.AllowPaging = true; gridView1.PagerSettings.Mode = PagerButtons.Numeric; gridView1.PagerSettings.Position = PagerPosition.Bottom; gridView1.PagerSettings.PageButtonCount = 10; gridView1.PageIndexChanging += new GridViewPageEventHandler(this.GridView1_PageIndexChanging); table = new DataTable(); table.Columns.Add("FirstName"); table.Columns.Add("LastName"); DataRow row = table.NewRow(); row["FirstName"] = "John"; row["LastName"] = "Johnoson"; table.Rows.Add(row); row = table.NewRow(); row["FirstName"] = "Johnny"; row["LastName"] = "Marley"; table.Rows.Add(row); row = table.NewRow(); row["FirstName"] = "Kate"; row["LastName"] = "Li"; table.Rows.Add(row); panel.ContentTemplateContainer.Controls.Add(gridView1); gridView1.DataSource = table; gridView1.DataBind(); } protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView gridView1 = (GridView)sender; gridView1.PageIndex = e.NewPageIndex; gridView1.DataSource = table; gridView1.DataBind(); } } Please help me, Thank you.

    Read the article

  • c# winForms open forms inside mainform

    - by user508284
    Hello guys, I have programmed c# application i will post screenshot. In this main form is 3 buttons which opens different forms. Now i decided to modify this application I want to Make one main form with strip menu which will open this forms. I used this code but i don't like or i'm doing something wrong. I don't like because there is child controls(minimize, maximize, close) in parent (please see second picture ): Please advice me something. Is MDI good for such job? Thanks! Sell sell = new Sell(); sell.MdiParent = this; sell.Dock = DockStyle.Fill; sell.Show();`

    Read the article

  • Chart Control Inside SSRS ReportViewer is Viewable From Localhost But Not Internet

    - by Daniel Coffman
    A project I own was just moved from an older server to a new one, and in the process of moving the web folder, re-deploying the SSRS reports, restoring the database, configuring IIS, etc... I have lost the ability to view the Microsoft Chart Controls that are embedded in the SSRS reports, that are then displayed by a Microsoft.ReportViewer. I could view them both locally and remotely (via the internet) on the old server. I can view them if I preview the SSRS report in Visual Studio. The report displays fine, only missing all the embedded charts. I can still view them locally through the web browser, just not from the internet. What am I missing? I tried giving permissions to the ChartImageHandler temp storage folder, but it didn't work. I'm getting the Javascript error: Error: ClientReport380ec8ca0c294a809e9986c1bef9db1c is undefined

    Read the article

  • preg_match_all and newlines inside quotes

    - by David
    Another noob regex problem/question. I'm probably doing something silly so I thought I'd exploit the general ingenuity of the SO regulars ;) Trying to match newlines but only if they occur within either double quotes or single quotes. I also want to catch strings that are between quotes but contain no newlines. Okay so there's what i got, with output. Below that, will be the output I would like to get. Any help would be greatly appreciated! :) I use Regex Coach to help me create my patterns, being a novice and all. According to RC, The pattern I supply does match all occurances within the data, but in my PHP, it skips over the multi-line part. I have tried with the 'm' pattern modifier already, to no avail. Contents of $CompressedData: <?php $Var = "test"; $Var2 = "test2"; $Var3 = "blah blah blah blah blah blah blah blah blah"; $Var4 = "hello"; ?> Pattern / Code: preg_match_all('!(\'|")(\b.*\b\n*)*(\'|")!', $CompressedData, $Matches); Current print_r output of $Matches: Array ( [0] => Array ( [0] => "test" [1] => "test2" [2] => "hello" ) ... } DESIRED print_r output of $Matches: Array ( [0] => Array ( [0] => "test" [1] => "test2" [2] => "blah blah blah blah blah blah blah blah blah" [3] => "hello" ) ... }

    Read the article

  • Smooth mousover images inside scaled Flex App?

    - by Josh Handel
    I have a flex app I am scaling using systemManager.stage.scaleMode=StageScaleMode.NO_BORDER; for the most part it works well except for my bitmap data (mostly png's from the designers). I can set the mx:image tags to smoothBitmapContent=true and that works great for everything except my mouseover objects. When I do a mouseover, the source is being changed from one embedded image to another embedded image. I have tried several (many) online "smoothimage" classes, and tried to write my own, I have tried to reset smoothBitmapContent every chance I get but still no dice. It seems to mee that because I am scaling at the app level, that the flopped out bitmap is not getting smoothed when it renders. Does anyone have any suggestions on how to keep things smooth (perhaps there is a flag to tell Flex to smooth stuff when it scales it?). Thanks Josh

    Read the article

  • C# HTML tags inside GridView

    - by Geo Ego
    I have a SharePoint web part that I wrote in C# which is used to display SQL Server data based on user selections. I pull the data with a DataReader, fill a DataSet with it, and set that DataSet as the DataSource in a GridView and add that control to my page. The only problem I'm facing is that line breaks in the data fields are not being rendered at all. I'm simply getting a block of text that ignores the breaks that are present in the database when it's rendered to HTML. I tried a regex: Regex rgx = new Regex("\n"); string inputStr = Convert.ToString(dr[x]); string outputStr = rgx.Replace(inputStr, "<br />"); newRow[ds3.Tables["Bobst Specs 3"].Columns[x]] = outputStr; While that does detect and replace the newlines, I merely get the text "" with no line breaks. I also tried changing my SQL query to something along the lines of: SELECT REPLACE (fldCustomerName, '. ', '.' + @NewLineChar) This apparently renders more newlines. I can see that they are present, because if I also insert the regex they are affected, but do not create line breaks. I'm not sure how to replace these, and what with, to get the lines to actually break.

    Read the article

  • How to Make URLs clickable inside of UITableViewCell ?

    - by Chris
    I know how to use UIWebView and can invoke a WebView if it is associated with a specific button or UITableViewCell. What I am trying to achieve is to have a UITableViewCell with a chunk of text. That chunk of text might contain a URL. I want to make the URL into a clickable link and have that link open into a WebView. My thought so far has been that I need to detect a link and insert it as a UIButton within the cell... but I don't know if that is the right way to go about this. Any ideas or input would be much appreciated.

    Read the article

  • Response.Redirect not working inside an custom ActionFilter

    - by mitch
    My code is the following public class SessionCheckAttribute : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { if (/*condition*/) { filterContext.HttpContext.Response.Redirect("http://www.someurl.com",true); } base.OnActionExecuting(filterContext); } } Now, the question is WHY does the action that is has [SessionCheck] applied to it STILL executes. Any ideas? Thanks.

    Read the article

  • Detecting a Dispose() from an exception inside using block

    - by Augusto Radtke
    I have the following code in my application: using (var database = new Database()) { var poll = // Some database query code. foreach (Question question in poll.Questions) { foreach (Answer answer in question.Answers) { database.Remove(answer); } // This is a sample line that simulate an error. throw new Exception("deu pau"); database.Remove(question); } database.Remove(poll); } This code triggers the Database class Dispose() method as usual, and this method automatically commits the transaction to the database, but this leaves my database in an inconsistent state as the answers are erased but the question and the poll are not. There is any way that I can detect in the Dispose() method that it being called because of an exception instead of regular end of the closing block, so I can automate the rollback? I don´t want to manually add a try ... catch block, my objective is to use the using block as a logical safe transaction manager, so it commits to the database if the execution was clean or rollbacks if any exception occured. Do you have some thoughts on that?

    Read the article

  • MySQL - NULL value check and Dynamic SQL inside stored procedure

    - by Mithun P
    DROP PROCEDURE IF EXISTS HaveSomeFun; CREATE PROCEDURE HaveSomeFun(user_id CHAR(50),house_id CHAR(50),room_id CHAR(50),fun_text TEXT,video_url CHAR(100)) BEGIN DECLARE query_full TEXT; SET @fields_part = 'INSERT INTO fun(FunKey,UserKey,FunBody,LastModified'; SET @values_part = CONCAT(') VALUES( NewBinKey(), KeyToBin(\"', user_id, '\"), \"', fun_text, '\", NOW() '); IF (house_id) THEN SET @fields_part = CONCAT(@fields_part, ', HouseKey'); SET @values_part = CONCAT(@values_part, ', KeyToBin(\'', house_id, '\')'); END IF; IF (room_id) THEN SET @fields_part = CONCAT(@fields_part, ', RoomKey'); SET @values_part = CONCAT(@values_part, ', KeyToBin(\'', room_id, '\')'); END IF; IF (video_url IS NOT NULL) THEN SET @fields_part = CONCAT(@fields_part, ', VideoURL'); SET @values_part = CONCAT(@values_part, ', "', video_url, '"'); END IF; SET query_full = CONCAT(@fields_part, @values_part, ' );'); SET @query_full = query_full; PREPARE STMT FROM @query_full; EXECUTE STMT; SELECT query_full; END; And CALL HaveSomeFun('29B455DE-A9BC-102D-9C16-00163EEDFCFC', '', 'F82C47A8-64DE-11DF-9D7E-0026B9481364', 'Jokes apart', ''); will construct the below string in the variable query_full INSERT INTO fun(FunKey,UserKey,FunBody,LastModified, VideoURL) VALUES( NewBinKey(), KeyToBin("29B455DE-A9BC-102D-9C16-00163EEDFCFC"), "Jokes apart", NOW() , "" ); But I need to get INSERT INTO fun(FunKey,UserKey,FunBody,LastModified, RoomKey, VideoURL) VALUES( NewBinKey(), KeyToBin("29B455DE-A9BC-102D-9C16-00163EEDFCFC"), "Jokes apart", NOW() , KeyToBin('F82C47A8-64DE-11DF-9D7E-0026B9481364'), "" ); Something is missing in the check IF (room_id) THEN. But I cannot impose IF (room_id IS NOT NULL) THEN since it will create KeyToBin('') and RoomKey is foreign key , KeyToBin('') will produce an invalid RoomKey. Any Idea?

    Read the article

  • Proper way to setup a UISegmentedControll on UINavigationController UINavigationBar all inside UITab

    - by Kaspa
    The title pretty much describes it all. The problem being the handling of the UISegmentedControll callbacks (button presses). If the content type of all of the nested views was the same (i.e. some UITableViewControllers) then I could just switch dataSource'es and reload the tables. However this is not the case, I have 3 very different views in there that allow further drilldown / interaction based on the NavigationControllers. So the way I have this set up ATM is that there is a "container" class that I put all of the UINavigationControllers in. They all share the same and one UISegmentedController and I redirect the callbacks to the container view controller. This does not feel too good at all. Additionally there is a problem when the user taps on the tab bar icon, the navigation controller pops to root which is ... the empty container view. Here's a picture of what I want to achieve:

    Read the article

  • Using only alphanumeric characters(a-z) inside toCharArray

    - by Aaron
    Below you will find me using toCharArray in order to send a string to array. I then MOVE the value of the letter using a for statement... for(i = 0; i < letter.length; i++){ letter[i] += (shiftCode); System.out.print(letter[i]); } However, when I use shiftCode to move the value such as... a shifted by -1; I get a symbol @. Is there a way to send the string to shiftCode or tell shiftCode to ONLY use letters? I need it to see my text, like "aaron", and when I use the for statement iterate through a-z only and ignore all symbols and numbers. I THINK it is as simple as... letter=codeWord.toCharArray(a,z); But trying different forms of that and googling it didn't give me any results. Perhaps it has to do with regex or something? Below you will find a complete copy of my program; it works exactly how I want it to do; but it iterates through letters and symbols. I also tried finding instructions online for toCharArray but if there exists any arguments I can't locate them. My program... import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /* * Aaron L. Jones * CS219 * AaronJonesProg3 * * This program is designed to - * Work as a Ceasar Cipher */ /** * * Aaron Jones */ public class AaronJonesProg3 { static String codeWord; static int shiftCode; static int i; static char[] letter; /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { // Instantiating that Buffer Class // We are going to use this to read data from the user; in buffer // For performance related reasons BufferedReader reader; // Building the reader variable here // Just a basic input buffer (Holds things for us) reader = new BufferedReader(new InputStreamReader(System.in)); // Java speaks to us here / We get it to query our user System.out.print("Please enter text to encrypt: "); // Try to get their input here try { // Get their codeword using the reader codeWord = reader.readLine(); // Make that input upper case codeWord = codeWord.toUpperCase(); // Cut the white space out codeWord = codeWord.replaceAll("\\s",""); // Make it all a character array letter = codeWord.toCharArray(); } // If they messed up the input we let them know here and end the prog. catch(Throwable t) { System.out.println(t.toString()); System.out.println("You broke it. But you impressed me because" + "I don't know how you did it!"); } // Java Speaks / Lets get their desired shift value System.out.print("Please enter the shift value: "); // Try for their input try { // We get their number here shiftCode = Integer.parseInt(reader.readLine()); } // Again; if the user broke it. We let them know. catch(java.lang.NumberFormatException ioe) { System.out.println(ioe.toString()); System.out.println("How did you break this? Use a number next time!"); } for(i = 0; i < letter.length; i++){ letter[i] += (shiftCode); System.out.print(letter[i]); } System.out.println(); /**************************************************************** **************************************************************** ***************************************************************/ // Java speaks to us here / We get it to query our user System.out.print("Please enter text to decrypt: "); // Try to get their input here try { // Get their codeword using the reader codeWord = reader.readLine(); // Make that input upper case codeWord = codeWord.toUpperCase(); // Cut the white space out codeWord = codeWord.replaceAll("\\s",""); // Make it all a character array letter = codeWord.toCharArray(); } // If they messed up the input we let them know here and end the prog. catch(Throwable t) { System.out.println(t.toString()); System.out.println("You broke it. But you impressed me because" + "I don't know how you did it!"); } // Java Speaks / Lets get their desired shift value System.out.print("Please enter the shift value: "); // Try for their input try { // We get their number here shiftCode = Integer.parseInt(reader.readLine()); } // Again; if the user broke it. We let them know. catch(java.lang.NumberFormatException ioe) { System.out.println(ioe.toString()); System.out.println("How did you break this? Use a number next time!"); } for(i = 0; i < letter.length; i++){ letter[i] += (shiftCode); System.out.print(letter[i]); } System.out.println(); } }

    Read the article

  • [Android] ProgressBar inside SimpleAdapter

    - by lemon
    I'm trying to add a ProgressBar to my row.xml view but I can't seem to make it work I keep getting 06-09 12:44:44.802: ERROR/AndroidRuntime(1012): java.lang.IllegalStateException: android.widget.ProgressBar is not a view that can be bounds by this SimpleAdapter ArrayList arr = new ArrayList(); HashMap map = new HashMap(); map.put("progress", 10); arr.add(map); String [] fieldNames = {"progress"}; int [] fieldIds = {R.id.progress}; SimpleAdapter adapter = new SimpleAdapter(this, arr, R.layout.row, fieldNames, fieldIds); list = (ListView) findViewById(R.id.list); list.setAdapter(adapter); <ProgressBar android:id="@+id/progress" style="?android:attr/progressBarStyleHorizontal" android:max="100" android:progress="5" android:layout_width="fill_parent" android:layout_height="fill_parent" /> Does anyone have any idea what I'm missing?

    Read the article

  • cannot output a json encoded dict containing accents (noob inside)

    - by user296546
    Hi all, here is a fairly simple example wich is driving me nuts since a couple of days. Considering the following script: # -*- coding: utf-8 -* from json import dumps as json_dumps machaine = u"une personne émérite" print(machaine) output = {} output[1] = machaine jsonoutput = json_dumps(output) print(jsonoutput) The result of this from cli: une personne émérite {"1": "une personne \u00e9m\u00e9rite"} I don't understand why their such a difference between the two strings. i have been trying all sorts of encode, decode etc but i can't seem to be able to find the right way to do it. Does anybody has an idea ? Thanks in advance. Matthieu

    Read the article

  • grep 5 seconds of input from the serial port inside a shell-script

    - by pica
    I've got a device that I'm operating next to my PC and as it runs it's spitting log lines out it's serial port. I have this wired to my PC and I can see the log lines fine if I'm using either minicom or something like: ttylog -b 115200 -d /dev/ttyS0 I want to write 5 seconds of the device serial output to a temp file (or assign it to a variable) and then later grep that file for keywords that will let me know how the device is operating. I've already tried redirecting the output to a file while running the command in the background, and then sleeping 5 seconds and killing the process, but the log lines never get written to my temp file. Example: touch tempFile ttylog -b 115200 -d /dev/ttyS0 >> tempFile & serialPID=$! sleep 5 #kill ${serialPID} #does not work, gets wrong PID killall ttylog cat tempFile The file gets created but never filled with any data. I can also replace the ttylog line with: ttylog -b 115200 -d /dev/ttyS0 |tee -a tempFile & In neither case do I ever see any log lines logged to stdout or the log file unless I have multiple versions of ttylog running by mistake (see commented out line, D'oh). I have no idea what's going on here. It seems to be a failure of redirection within my script. Am I on the right track? Is there a better way to sample 5 seconds of the serial port?

    Read the article

  • Malloc inside another function (ANSI C)

    - by Casper
    Hi I'll go straight to it. I'm working on an assignment, where I suddenly ran into trouble. I have to allocate a struct from within another function, obviously using pointers. I've been staring at this problem for hours and tried in a million different ways to solve it. This is some sample code (very simplified): ... some_struct s; printf("Before: %d\n", &s"); allocate(&s); printf("After: %d\n", &s"); ... /* The allocation function */ int allocate(some_struct *arg) { arg = malloc(sizeof(some_struct)); printf("In function: %d\n", &arg"); return 0; } This does give me the same address before and after the allocate-call: Before: -1079752900 In function: -1079752928 After: -1079752900 I know it's probably because it makes a copy in the function, but I don't know how to actually work on the pointer I gave as argument. I tried defining some_struct *s instead of some_struct s, but no luck. I tried with: int allocate(some_struct **arg) which works just fine (the allocate-function needs to be changed as well), BUT according to the assignment I may NOT change the declaration, and it HAS to be *arg.. And it would be most correct if I just have to declare some_struct s.. Not some_struct *s. I hope I make sense and some of you out there can help me :P Thanks in advice

    Read the article

  • ipad: UINavigationController Inside a ModalView not pushing views

    - by nickthedude
    I have a UINavigationController with a UIViewcontroller containing a tableview that is being presented as a UIModalPresentationFormSheet on the ipad. Which works fine until I try to push another view on top of it. Nothing happens anyone else have this issue? It also works perfectly on the iphone. and the didselectrowatindexpath is not a branched method. Nick

    Read the article

  • Something like jQuery's .resizable but without the div's inside

    - by Brendon Muir
    Hi everyone, this is just a quick probe to see if this is technically possible. I'm wanting to enable the resizing of an image in the browser (also within a contentEditable area). Firefox and IE already allow this to be done with their inbuilt handles and it works fine. I'm wanting to implement something for Safari however because it doesn't support this natively. I've had a go with jQuery's resizable method and it does a very good job, however it relies on inserting a bunch of div's along with the image and wrapping that in a big div. This would normally be fine if we weren't concerned with the code generated in the contentEditable area, but we are because it's going to be saved back to the server. I could strip this extra stuff out on save, but I was thinking, is it technically possible to create a resizing script for images that doesn't rely on adding extra div's? Even if we decide to go without handles for now, and just concentrate on detecting when a user is close to the edge of the image, change the mouse cursor to a resizing one, and detect clicks and drags in the 5px's around the edge of the image, is this possible? If it's possible, I'm assuming (hoping) that perhaps it's already been done, but my searching hasn't turned up anything so far. Keen to hear any ideas :)

    Read the article

  • WPF Accessing Items inside Listbox which has a UserControl as ItemTemplate

    - by Turker
    I have Window that has a ListBox ListBox(MyListBox) has a DataTable for its DataContext ListBox's ItemSource is : {Binding} Listbox has a UserControl(MyUserControl) as DataTemplate UserControl has RadioButtons and TextBoxes (At first They're filled with values from DataTable and then user can change them) Window has one Submit Button What I want to do is, when user clicks the submit button For each ListBox Item, get the values form UserControl's TextBoxes and RadioButtons. I was using that method for this job : foreach(var element in MyListBox.Items) { var border = MyListBox.ItemContainerGenerator.ContainerFromItem(element)as FrameworkElement; MyUserControl currentControl = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(myBorder,0) as Border,0)as ContentPresenter,0)as MyUserControl; //And use currentControl } I realised nothing when using 3-5 items in Listbox. But when I used much more items, I saw that "var border" gets "null" after some elements looped in foreach function. I found the reason here : http://stackoverflow.com/questions/1675926/listview-itemcontainergenerator-containerfromitemitem-return-null-after-20-item So what can I do now? I want to access all items and get their values sitting on user controls. Thanks

    Read the article

  • using href links inside <option> tag

    - by makmour
    I have the following html code: <select name="forma"> <option value="Home">Home</option> <option value="Contact">Contact</option> <option value="Sitemap">Sitemap</option> </select> how can i make Home, Contact and Sitemap values as links? i used the following code an as i expected it didnt work, <select name="forma"> <option value="Home"><a HREF="home.php">Home</a></option> <option value="Contact"><a HREF="contact.php">Contact</a></option> <option value="Sitemap"><a HREF="sitemap.php">Sitemap</a></option> </select>

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >